-
Notifications
You must be signed in to change notification settings - Fork 1
Error Handling
Alex Aubé edited this page Apr 22, 2015
·
3 revisions
Avoid to over use error handling code, manage errors efficiently
- Simplify the code greatly
- Not an infinity of conditionals
- Signed exception break the Opened Closed Principle
- It has effect on all the users of the class
- It depends from the language of course. Ex: Go doesn't not have exception classes
new IOException(’Imposible d’ouvrir foo.txt’);
- Also depends of the language
- You're asking for trouble when you do
- Solutions: Null Objects, Maybe Objects, empty objects...
- Tell don't ask
- This is not the opinion of everybody in the community
- Leads to ugly code in general
- Creates security leaks