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

NullPointer in ThrowExceptionProcessor.getTraceLabel

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment