Hacker News new | ask | show | jobs
by the_gipsy 1064 days ago
In practice there is a lot of paths that you don't want to "crash" on, but try the next thing etc.
1 comments

Don't model those as Exceptions, because they are not exceptional. They are control flow.
You can't have your pie and eat it too. Some callers will want a Result, some will want to panic. A Result can be panicked on very easily, but handling control flow with exceptions and try/catch has been proven a huge failure.
That idea just leads to confusion, as the line between exceptional or not will always be blurry, and depend on how it is called, the specific input data, your hardware state, etc.

you basically end up needing to write your api twice.