Error management
coding python error thoughts
To βtry:β or not to βtry:β. Some thoughts.
I made a habit at work to structure my programs around an error management backbone.
For business, it is critical to ensure that all errors are caught and handled, with critical ones getting proper feedback to the user, and logged for the backend team.
That applies to serious business.
Dr Jekyll and Mr Hyde
Work/robust coding VS fun coding
But sometimes it is overkill:
- Adding error management adds complexity. And a simple script of 10 lines becomes a fat one of 50-80 lines.
- Logging may generate errors!
- Error inside error management functions are also a thingβ¦
- Handling all errors may require a lot of effort, for errors that will almost never happen (config missing or else)
All in all, a nice crash when acceptable may bring as much information. In this case, error is managed by the upper layer (the operating system), and life goes onβ¦