<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the error message inside Route (cOnException) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222944#M16333</link>
    <description>&lt;P&gt;In ESB you never ever need to use GlobalMap. Everything is stored within the Camel Exchange message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for your need, you can use a cProcessor after cOnException, with some code like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Exception ex = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,Exception.class); 
if ( ex == null) { ex = pExchange.getProperty(Exchange.EXCEPTION_HANDLED,Exception.class); } 
if ( ex != null) { 
&amp;nbsp; &amp;nbsp; &amp;nbsp; x_error_message = ex.getLocalizedMessage();
&amp;nbsp; &amp;nbsp; &amp;nbsp; x_error_class = ex.getClass().getCanonicalName();

}

exchange.getIn().setBody(x_error_message+' - '+x_error_class);

&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Feb 2019 08:37:29 GMT</pubDate>
    <dc:creator>Loko</dc:creator>
    <dc:date>2019-02-05T08:37:29Z</dc:date>
    <item>
      <title>How to get the error message inside Route (cOnException)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222942#M16331</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to get&amp;nbsp;the exception message which is caught using cOnException.&lt;/P&gt; 
&lt;P&gt;I can see the stack trace in the &lt;STRONG&gt;cLog&lt;/STRONG&gt; but I want to&amp;nbsp;get the actual value and perform some action. As can be seen in the example below, how can I get the &lt;STRONG&gt;ERROR_MESSAGE&lt;/STRONG&gt; of &lt;STRONG&gt;cOnException_1&lt;/STRONG&gt; in &lt;STRONG&gt;cSetBody_1? &lt;/STRONG&gt;Below code is not even compiling.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="query.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2cP.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130607iA6BB0F23BE3644A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2cP.jpg" alt="0683p000009M2cP.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222942#M16331</guid>
      <dc:creator>Mahboob</dc:creator>
      <dc:date>2024-11-16T06:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the error message inside Route (cOnException)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222943#M16332</link>
      <description>&lt;P&gt;Suggestions, please&amp;nbsp; !!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 08:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222943#M16332</guid>
      <dc:creator>Mahboob</dc:creator>
      <dc:date>2019-01-31T08:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the error message inside Route (cOnException)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222944#M16333</link>
      <description>&lt;P&gt;In ESB you never ever need to use GlobalMap. Everything is stored within the Camel Exchange message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for your need, you can use a cProcessor after cOnException, with some code like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Exception ex = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,Exception.class); 
if ( ex == null) { ex = pExchange.getProperty(Exchange.EXCEPTION_HANDLED,Exception.class); } 
if ( ex != null) { 
&amp;nbsp; &amp;nbsp; &amp;nbsp; x_error_message = ex.getLocalizedMessage();
&amp;nbsp; &amp;nbsp; &amp;nbsp; x_error_class = ex.getClass().getCanonicalName();

}

exchange.getIn().setBody(x_error_message+' - '+x_error_class);

&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 08:37:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222944#M16333</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2019-02-05T08:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the error message inside Route (cOnException)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222945#M16334</link>
      <description>&lt;P&gt;Thanks Loko.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 09:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-the-error-message-inside-Route-cOnException/m-p/2222945#M16334</guid>
      <dc:creator>Mahboob</dc:creator>
      <dc:date>2019-02-06T09:11:54Z</dc:date>
    </item>
  </channel>
</rss>

