ErrorHandling
From SPA Wiki
Contents |
Notes from Error Handling BOF Session
SPA2006 Charles Weir 28/03/2006
Literature
- Book: Robust Java
- Pattern paper: Alan Griffiths http://www.octopull.demon.co.uk/sw-dev/IfProblemsArise.html
- Arno Haase - Java Error Handling patterns http://www.haase-consulting.com/veroeffentlichungen.html
- Andy Longshaw, Eoin Woods - Patterns for Generation, Handling and Management of Errors http://www.blueskyline.com/ErrorPatterns/A2-LongshawWoods6.pdf
- Neil Harrison - Logging Patterns
- Charles Weir - paper, not EuroPLoP it turns out, but EXE article http://www.charlesweir.com/papers/error.pdf
Raising and Handling Errors
- User vs.. techie as target for reporting - front end vs. back end stakeholders.
- Blue screen sometimes better than wrong - or 24x7 would be different.
- Exceptions vs. Error codes - which gives better discipline?
- About state-based vs. stack-based.
- “Error” = change to state. Java/C%2b%2b exception only because stack-based paradigm.
- Classification of errors: Business vs. Technical, User vs. System vs. bug.
- Exception al condition vs. expected error
- 3 parts: Detect, Report, Handle. Need to Know what is your strategy is.
- Handling - repair or ignore.
- DB Transactions
- Recovery vs.. logging
Error Handling Mechanisms
- Terminate on bug?
- Global error handler concept
- Inherit from “RuntimeException” - no need to declare.
- Strongly vs. weekly enforced exceptions
- Exception that deals with itself? Tricky because no context.
- Double dispatch exceptions?
- Factory for exceptions passed into function?
- Set up error handlers with context, then invoke (UNIX signal handler paradigm).
Error Strategy
- Exception handling is just a mechanism for separation of concerns
- Error transfer between components and systems?
- E.H. Strategy. (An example: http://www.octopull.demon.co.uk/java/ExceptionalJava.html)
- E.H. is modular.
- Errors part of the contract - but “unexpected” errors.
- Error perspective for systems
- Third party/other systems Error Handling policy out of our control
- Quality of Service influences
- What data goes with to allow handling (context)?
- Attributes of errors (“retry-able”, ... )
Teaching Error Handling
- Java Libraries = bad examples
- Error handling by callback function.
- Don’t like to think about errors (not sexy
- Study and compare 2 applications?
---
Next steps:
- Use Wiki as basis for discussion...
- Study 2 example applications.
- Produce examples of ‘Error Handling Strategy’.
---
http://today.java.net/pub/a/today/2006/04/06/exception-handling-antipatterns.html
--- CW: Someone (I assume Peter Sommerlad) posted "Wiki for further discussion: http://wiki.hsr.ch/DesignSense "
I suggest, though, as there's nothing currently there we continue discussion here and create new pages if required.
---
More comments here...