If you’re using error values, you probably want to avoid exceptions. However, you may be using other code which throws exceptions.
In this case, do what Joel does to avoid exceptions:
- don’t throw your own exceptions
- catch and handle every possible exception immediately
- Robot – Photo by Aman Pal on Unsplash