It is one approach to error handling, which is useful in some situations, less so in others. As @rdeits said, Julia is flexible enough to allow you to experiment with other approaches. Many functions in Base
and in packages have a form that uses a type union instead of throwing an error, eg Base.tryparse
, you can of course follow this pattern with your own functions.