<?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 error catching in print task in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-catching-in-print-task/m-p/528193#M49263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using printTask and am having trouble breaking out of the print task itself.&amp;nbsp; While I can identify the error (using the printTask.error event)&amp;nbsp; I can't seem to stop the overall print function from continuing to run.&amp;nbsp; My basic setup is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function createPrintTask () {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // params =&amp;nbsp;&amp;nbsp; a bunch of parameters for the different templates.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask = new esri.tasks.PrintTask(location of print service);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask.execute(params, printResult);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask.on('error', function () {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert ("error");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&amp;nbsp;&amp;nbsp; ////&amp;nbsp; This is where I'd like to get out of the printTask execution&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function printResult(result) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; // handles print result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to exit,&amp;nbsp; I've tried using 'break;' and&amp;nbsp; 'return false;' .&amp;nbsp; What I'd like to happen is that the printTask would stop executing.&amp;nbsp; Any ideas on how to do this?&amp;nbsp; What do I need to actually stop: the printTask object, or the createPrintTask function? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2014 18:01:29 GMT</pubDate>
    <dc:creator>DavidMarquardt</dc:creator>
    <dc:date>2014-02-24T18:01:29Z</dc:date>
    <item>
      <title>error catching in print task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-catching-in-print-task/m-p/528193#M49263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using printTask and am having trouble breaking out of the print task itself.&amp;nbsp; While I can identify the error (using the printTask.error event)&amp;nbsp; I can't seem to stop the overall print function from continuing to run.&amp;nbsp; My basic setup is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function createPrintTask () {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // params =&amp;nbsp;&amp;nbsp; a bunch of parameters for the different templates.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask = new esri.tasks.PrintTask(location of print service);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask.execute(params, printResult);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; printTask.on('error', function () {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert ("error");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&amp;nbsp;&amp;nbsp; ////&amp;nbsp; This is where I'd like to get out of the printTask execution&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function printResult(result) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; // handles print result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to exit,&amp;nbsp; I've tried using 'break;' and&amp;nbsp; 'return false;' .&amp;nbsp; What I'd like to happen is that the printTask would stop executing.&amp;nbsp; Any ideas on how to do this?&amp;nbsp; What do I need to actually stop: the printTask object, or the createPrintTask function? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 18:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-catching-in-print-task/m-p/528193#M49263</guid>
      <dc:creator>DavidMarquardt</dc:creator>
      <dc:date>2014-02-24T18:01:29Z</dc:date>
    </item>
  </channel>
</rss>

