Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2158

onException - Should look up the hierarchy for exact matches to avoid being handled by Exception.class where an exact match existed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.1, 2.0.0
    • 2.1.0
    • camel-core
    • None

    Description

      See nabble
      http://old.nabble.com/Exception-handling-...-onException-to26215607.html

                      onException(UnmarshalException.class).handled(true).to("mock:ue");
                      
                      onException(Exception.class).handled(true).to("mock:exception");
      
                      from("direct:start")
                          .throwException(new UnmarshalException("Could not unmarshal", new IllegalArgumentException("Damn")));
      

      The code above should be handled by the UnmarshalException.class as its the best candidate.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: