title: Spring Integration error is attaching completed payload
body: <p>I have a listener to the JMS. Once I read the message then I convert to my custom object</p>
  
  <pre><code>public IntegrationFlow queueProcessorFlow() {
          return IntegrationFlows.from(Jms.inboundAdapter(jmsTemplate)
  
                          .destination("test_queue"),
                  c -&gt; c.poller(Pollers.fixedDelay(5000L)
                          .maxMessagesPerPoll(1)))
  
                  //convert json to our custom object
                  .transform(new JsonToQueueEventConverterTransformer(springBeanFactory))
  
                  .transform(new CustomTransformer(springBeanFactory))
  
  
                  .handle(o -&gt; {
  
  
                  }).get();
      }
  </code></pre>
  
  <p>The transformer</p>
  
  <pre><code>public class CustomerTransformer implements GenericTransformer&lt;CustomPojo, CustomPojo&gt; {
  
  
      private final QueueDataProcessorSpringBeanFactory factory;
  
  
      @Override
      public CustomPojo transform(CustomPojo CustomPojo) {
          try {
  
             //do something e.g. service call
             throw new Exception("This failed mate !! SOS");
          } catch (Exception e) {            
  
          //ISSUE here 
          //e contains the original payload in the stack trace 
              throw new RuntimeException(e);
          }
          return CustomPojo;
  
      }
  </code></pre>
  
  <p>Now when I throw my custom exception the stack trace contains everything. It even contains the payload. I am not interested in the payload in case of exception.</p>
  
  <p>How do I update not to include payload?</p>
  
  <p>** <strong>Update</strong> ** </p>
  
  <p>After changing as per answer I still see the issue</p>
  
  <pre><code>org.springframework.integration.transformer.MessageTransformationException: Failed to transform Message; nested exception is org.springframework.messaging.MessageHandlingException: nested exception is org.springframework.integration.transformer.MessageTransformationException: Error initiliazing the :; nested exception is CustomException Error lab lab lab  , failedMessage=GenericMessage [payload=
  </code></pre>
  
  <p>my error handler</p>
  
  <pre><code> @Bean
      public IntegrationFlow errorHandlingFlow() {
          return IntegrationFlows.from("errorChannel")
                  .handle(message -&gt; {
                      try {
  
                          ErrorMessage e = (ErrorMessage) message;
                          if (e.getPayload() instanceof MessageTransformationException) {
                              String stackTrace = ExceptionUtils.getStackTrace(e.getPayload());
                              LOG.info("Exception trace {} ", stackTrace);
  </code></pre>