Results 1 to 2 of 2

Thread: Skipping based on Throwable.getCause() ?

  1. #1

    Default Skipping based on Throwable.getCause() ?

    I'd like to know the best way to configure chunk skippable-exception-classes such that the results of (for example), FlatFileParseException.getCause() could be used as input to the decision rather than the Class hierarchy.

    At the moment I am creating a specific kind of exception during line mapping and if that occurs I want to skip the item. However MyException is being caught by DefaultLineMapper and converted to a FlatFileParseException. I think that somewhere down the line the FlatFileParseException (containing MyException as it's cause), is being passed to a BinaryExceptionClassifier which looks at the class hierarchy of FlatFileParseException - it's not aware of Throwable and nested exceptions. This means I have no way of skipping when I throw instances of MyException - I need to skip all instances of FlatFileParseException.

    Is this correct and if so how can implement the behaviour I desire - namely skipping only on MyException?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    I think the best way currently is to implement ItemSkipPolicy and inject an instance of your policy instead of configuring the skip-limit and skippable-exceptions in the step.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •