2 ms·
Don't model those as Exceptions, because they are not exceptional. They are control flow.
by mrkeen 3y ago
Don't model those as Exceptions, because they are not exceptional. They are control flow.
- randyrand 3y agoThat 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.
- the_gipsy 3y agoYou 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.