4 ms·
Error handling is an everywhere concern. In general, recoverable errors are more local, and unrecoverable errors should crash/throw.
by timw4mail 6y ago
Error handling is an everywhere concern. In general, recoverable errors are more local, and unrecoverable errors should crash/throw.
- XorNot 6y agoThis doesn't feel like it translates into anything actionable though. For example: I've never had a problem with Python's approach of defaulting to exception handling because it seems to bridge that gap nicely: either you can handle it in your local catch block, or you want to send it higher up to see if something with hopefully more context knows what to do. Most error handling where "error's are values" is still ultimately doing this exact thing somehow it's just a question of with what implementation.
- PaulHoule 6y ago"Recoverable" means different things. Where I work we would rather the app crash than display incorrect data -- accuracy is critical to us. The engine control unit in your car has multiple degraded modes it operates in when parts like the oxygen sensor fail -- in that business the "show must go on" but so does the "check engine" light. Fly-by-wire airliners like the A320 and B777 also have a number of degraded modes that pilots are aware of and there is a huge database of experience that proves the concept. The 737 MAX hack tried to bolt a primitive form of flight envelope protection onto the old hydraulic control system but didn't consider that the plane would sometimes encounter degraded conditions such as one of two AoA vanes failed.
- timw4mail 6y agoAbsolutely, which is one of the reasons good error handling is difficult. The context of use for the current code determines how errors can be handled.