# Is there a better way to do error handling on Julia than try/catch?

**URL:** <https://discourse.julialang.org/t/is-there-a-better-way-to-do-error-handling-on-julia-than-try-catch/21716>\
**Category:** General Usage\
**Created:** [March 10, 2019, 8:43pm UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-do-error-handling-on-julia-than-try-catch/21716 "2019-03-10T20:43:59Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 11, 2019, 6:26am UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-do-error-handling-on-julia-than-try-catch/21716/6 "2019-03-11T06:26:52Z")

</div>

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.

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-better-way-to-do-error-handling-on-julia-than-try-catch/21716)._
