Issue Details (XML | Word | Printable)

Key: BATCH-188
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dave Syer
Reporter: Robert Kasanicky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

LogOrRethrowException handler swallows unclassified exceptions

Created: 01/Nov/07 12:07 PM   Updated: 07/Aug/08 10:06 AM
Component/s: Infrastructure
Affects Version/s: 1.0-m2
Fix Version/s: 1.0-m3
Security Level: Public (Public Issues)

Time Tracking:
Not Specified


 Description  « Hide
Copied from forum:

Question:
The LogOrRethrowExceptionHandler doesn't do anything with an Exception that is not classified as DEBUG,WARN,ERROR or RETHROW. Is there a reason why this class doesn't rethrow exceptions by default?

Reply:
LogOrRethrowExceptionHandler relies on ExceptionClassifier to classify the exception, so I think it is expected invariant that the exception always falls into one of the predefined categories. Adding an else clause that would throw an IllegalStateException if the exception has not been classified would make sense then.

Reply:
An IllegalStateException would indeed make sense.
Yesterday the LogOrRethrowExceptionHandler swallowed some ClassNotFoundExceptions that were being thrown. I would expect that any unexpected exception would stop the batch processing.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky added a comment - 01/Nov/07 12:17 PM
'swallows exceptions' is probably not the right expression, 'silently ignores' would be more accurate

Dave Syer added a comment - 02/Nov/07 04:24 AM
Added if/then/else and an IllegalStateException.

Dave Syer added a comment - 07/Aug/08 10:06 AM
Assume closed as resolved and released