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

NullPointer in ThrowExceptionProcessor.getTraceLabel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.17.3
    • 2.16.4, 2.17.4, 2.18.0
    • camel-core
    • None
    • Novice

    Description

      When using

      ProcessorDefinition.java
       throwException(Class<? extends Exception> type, String message) 
      

      to define a Exception and having the tracing set to True in Camel context, if an exception occurred, it will call

      ThrowExceptionProcessor.java
        public String getTraceLabel() {
              return "throwException[" + this.exception.getClass().getSimpleName() + "]";
          }
      

      But this.exception is null.
      A patch could be:

      ThrowExceptionProcessor.java
          public String getTraceLabel() {
              String className= this.exception==null?this.type.getSimpleName():this.exception.getClass().getSimpleName();
              return "throwException[" + className + "]";
          }
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: