3 ms·
There's a place for both. Error values for conditions that your client will want to handle, and exceptions or panics for all the fatal failures.
by golergka 5y ago
There's a place for both. Error values for conditions that your client will want to handle, and exceptions or panics for all the fatal failures.
- DangitBobby 5y agoI don't really understand the place of panics. It's not really up to a function to determine whether its error is unrecoverable (especially in the case of a library), it's up to the caller. And an unhandled Exception is, practically speaking, a panic. So it seems to me that Exception covers both use cases.