<?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: ((String)globalMap.get(&amp;quot;tSendMail_1_ERROR_MESSAGE&amp;quot;)) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196017#M354</link>
    <description>Thanks Shong. 
&lt;BR /&gt;Based on my request, "error message populated here when tSendMail component throws an exception" 
&lt;BR /&gt;Its currently printing the exception to the console based on: 
&lt;BR /&gt;&amp;lt;%}else{%&amp;gt; 
&lt;BR /&gt; System.err.println(e.toString()); 
&lt;BR /&gt; &amp;lt;%}%&amp;gt; 
&lt;BR /&gt;} 
&lt;BR /&gt;I havent selected 'Die on error' for the sendmail component so its printing to the console as above. 
&lt;BR /&gt;Can I instead have it populate the ERROR_MESSAGE property.. or is that only accessible and populated from a DIE ?</description>
    <pubDate>Tue, 19 Jun 2012 09:31:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-06-19T09:31:14Z</dc:date>
    <item>
      <title>((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196013#M350</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;Im trying to get the error message populated here when tSendMail component throws an exception.&lt;BR /&gt;javax.mail.MessagingException: Could not connect to SMTP host: &lt;BR /&gt;I dont see it doing it in the component, i.e. &lt;BR /&gt;} catch(Exception e){&lt;BR /&gt; &amp;lt;%if (isDieOnError){%&amp;gt;&lt;BR /&gt; throw(e);&lt;BR /&gt; &amp;lt;%}else{%&amp;gt;&lt;BR /&gt; System.err.println(e.toString());&lt;BR /&gt; &amp;lt;%}%&amp;gt;&lt;BR /&gt;}&lt;BR /&gt;Is it possible for me to add custom code to get it to populate the tSendMail_1_ERROR_MESSAGE property?&lt;BR /&gt;If so, please advise &lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 12:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196013#M350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196014#M351</link>
      <description>Hi
&lt;BR /&gt;Make sure the 'die on error' option is checked on the tSendMail component, so that the exception will be thrown. Normally, we use tLogCatcher component to capture the Java exception. In this case, you don't need to hard code to capture the exception message, the exception message is put into the global variable ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE")), and you can use this global variable to get the exception message if tSendMail fails, for example:
&lt;BR /&gt;tSendMail_1
&lt;BR /&gt; |
&lt;BR /&gt;onsubjoberror
&lt;BR /&gt; |
&lt;BR /&gt;tJava
&lt;BR /&gt;on tJava:
&lt;BR /&gt;String errorMessage = ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"));
&lt;BR /&gt;System.out.println(errorMessage);
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 18 Jun 2012 10:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196014#M351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-18T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196015#M352</link>
      <description>Thanks for replying. 
&lt;BR /&gt;The sendmail component is inside a joblet utilising the flow. 
&lt;BR /&gt;I dont want the main job to die (which happens when I select 'die on error' on the joblet sendmail component) but to continue processing the next record. 
&lt;BR /&gt;Could I programmatically set the ERROR message property based on the individual record failure? 
&lt;BR /&gt;Its currently printing the failure and moving onto the next record.</description>
      <pubDate>Mon, 18 Jun 2012 10:53:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196015#M352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-18T10:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196016#M353</link>
      <description>Hi
&lt;BR /&gt;Yes, the job will die and stop to run if this option 'die on error' is checked and the job has an error in the current record. According to your request, you need to redesign the job, use tRunJob to call a child job instead of using joblet. The job design looks like:
&lt;BR /&gt;parent job:
&lt;BR /&gt;tFileInputDelimited--row1--tFlowToIterate--iterate--&amp;gt;tRunJob
&lt;BR /&gt;on tRunJob: call the child job, uncheck the option 'die on error' so as to continue to execute next record even though an exception is thrown in the child job.
&lt;BR /&gt;child job:
&lt;BR /&gt;tSendMail
&lt;BR /&gt;tLogCatcher-main--tLogRow
&lt;BR /&gt;on tSendMail: check the option 'die on error'.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 19 Jun 2012 08:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196016#M353</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-19T08:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196017#M354</link>
      <description>Thanks Shong. 
&lt;BR /&gt;Based on my request, "error message populated here when tSendMail component throws an exception" 
&lt;BR /&gt;Its currently printing the exception to the console based on: 
&lt;BR /&gt;&amp;lt;%}else{%&amp;gt; 
&lt;BR /&gt; System.err.println(e.toString()); 
&lt;BR /&gt; &amp;lt;%}%&amp;gt; 
&lt;BR /&gt;} 
&lt;BR /&gt;I havent selected 'Die on error' for the sendmail component so its printing to the console as above. 
&lt;BR /&gt;Can I instead have it populate the ERROR_MESSAGE property.. or is that only accessible and populated from a DIE ?</description>
      <pubDate>Tue, 19 Jun 2012 09:31:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196017#M354</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-19T09:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: ((String)globalMap.get("tSendMail_1_ERROR_MESSAGE"))</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196018#M355</link>
      <description>Hi 
&lt;BR /&gt;If the option 'die on error' is not checked, the exception is not thrown out and printed to the console. You need to modify the component and hard code to populate the ERROR_MESSAGE property and put the error message to a global variable. This is not recommended, because you have to migrate the component also when upgrading product in the future. I still suggest you to redesign the job as I did. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 19 Jun 2012 10:47:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-globalMap-get-quot-tSendMail-1-ERROR-MESSAGE-quot/m-p/2196018#M355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-19T10:47:13Z</dc:date>
    </item>
  </channel>
</rss>

