Sometimes, coding defensively won't be the solution. Maybe a key part of your program requires reading a file on the network or accessing a database. If the resource can't be accessed due to a temporary network failure, there's really not much you can do in the absence of the data.
Handling errors like a pro
The try...catch statements
If you identify parts of your code where you think the execution can go off the rails due to conditions that are out of your control (that is, exceptional conditions—hence the name exception), you can use Julia's try...catch statements. This is exactly what it sounds like—you instruct the compiler to try a piece of code and if, as a result of a problem...