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

NullPointer in ThrowExceptionProcessor.getTraceLabel

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.17.3
    • Fix Version/s: 2.16.4, 2.17.4, 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: