While writing any code, what do we do if something breaks? One possible answer is to write fully correct code in one go, but that doesn't happen so often in the real world. Many a time, a developer ends up spending considerable amounts of time figuring out errors and later fixing them in code. But then, code that doesn't handle situations where it fails to handle the expected (or unexpected) errors can't be considered good code!
It is important to establish proper exception or error handling. This can be ensured by using Julia's built-in exception handling methods, which we will be discussing in this portion of the chapter.
Let's first see the basic difference between an error and an exception:
julia> println('hello world!') ERROR: syntax: invalid character literal
# To get the following, press CTRL+C during the...