Best practices for error trapping and exception handling in Julia as of mid 2022

Hey folks. I was trying to identify some best practices around error trapping or exception handling in Julia as of today, or at least mid-2022. I have found a bunch of blog posts on exception handling in Julia, for example. Here is another example. But I imagine that may of the recommended packages might be out of date, or may have been superseded by better packages, etc.

hence I was hoping that the community might identify or recommend some best practices and packages for error trapping or exception handling in julia. This can include anything from packages for nicer error messages, to more performant try/catch blocks, etc.

Thanks.

FYI: There’s also (I recalled a package having Go-like error handling, maybe I misremember, and had this one in mind):

1 Like

@Palli Oh yes, this is great. I really love Rust exception handling, it is really the best that I have ever seen. I will look at this package.

Try.jl uses a union instead of a Result{R,E} which I think is better for Julia.

2 Likes

@jar1 thanks for pointing out this package. Yeah, the setup looks very nice.

1 Like