3 ms·
Actually, I think exceptions are the clearest way to represent errors of any kind (reconcilable or not). > A null value, a plain "error" object, or an error ar
by hn_acc_2 7y ago
Actually, I think exceptions are the clearest way to represent errors of any kind (reconcilable or not).
> A null value, a plain "error" object, or an error argument
In my mind, this just adds a lot more mental overhead while also being less informative than a simple exception. Plus you have to keep track of which method your current library has chosen to represent errors.
Note I am biased from using Python for a long time.
- mratsim 7y agoFor me exceptions are for exceptional cases. Any time you have user input, you can expect errors and so should have proper paths to handle file not found, invalid input, ... For those case, exceptions should not be used.