<?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 trap API-level errors in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208268#M19341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For any call stacks that you initiate then I guess standard try/catch should work&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, I'll give that a go. In some cases though these errors may originate from run-time events which I can't predict now, which is why I'm hoping for a map-level onError event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2012 21:14:50 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2012-11-14T21:14:50Z</dc:date>
    <item>
      <title>How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208262#M19335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm seeing an error message in FireBug:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Error: Internal kml parser error.&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2compact"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2compact&lt;/A&gt;&lt;BR /&gt;Line 34&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not worried about fixing this error for the moment - I'd like to know how can I &lt;/SPAN&gt;&lt;STRONG&gt;trap&lt;/STRONG&gt;&lt;SPAN&gt; the error, so I can report it to the user?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The map has an &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#onLayersAddResult"&gt;onLayersAddResult&lt;/A&gt;&lt;SPAN&gt; event, which contains an Error handler. Is there a similar map-level error handling event which would trap the above KML parser error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like the &lt;/SPAN&gt;&lt;STRONG&gt;map&lt;/STRONG&gt;&lt;SPAN&gt; object needs an &lt;/SPAN&gt;&lt;STRONG&gt;onError()&lt;/STRONG&gt;&lt;SPAN&gt; event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2012 00:05:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208262#M19335</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-11-12T00:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208263#M19336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the results object passed to onLayersAddResult, are you seeing success: false and an error object?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 14:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208263#M19336</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-11-14T14:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208264#M19337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me rephrase to clarify:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are certain events for which the JS API provides an error handler. Eg, you can listen for a layer's &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/layer.htm#onError"&gt;onError&lt;/A&gt;&lt;SPAN&gt; event, which fires whenever there is a problem with a specific layer. You can listen for the map's &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#onLayerAddResult"&gt;onLayersAddResults&lt;/A&gt;&lt;SPAN&gt; event, which fires if there was a problem adding any layer to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to trap &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;any generic error&lt;/SPAN&gt;&lt;SPAN&gt; which is returned by the map object?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did something which caused the above-mentioned KML parser error, which triggered a FireBug error message. How can I trap those type of error messages (not specifically the KML parser error, but any error messages which are shown in FireBug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That way, I can warn users who are not using a debugging plugin that there has been a problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 17:57:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208264#M19337</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-11-14T17:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208265#M19338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You want to catch &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;STRONG&gt;unhandled exceptions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(and ideally you're hoping that the API doesn't just 'swallow' these thus preventing them propagating to your code)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208265#M19338</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2012-11-14T19:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208266#M19339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You want to catch &lt;SPAN style="font-style:italic;"&gt;&lt;STRONG&gt;unhandled exceptions&lt;/STRONG&gt;&lt;/SPAN&gt;, correct?&lt;BR /&gt;&lt;BR /&gt;(and ideally you're hoping that the API doesn't just 'swallow' these thus preventing them propagating to your code)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Rich,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yep, that's what I meant (and wish I could have said so succinctly).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208266#M19339</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-11-14T19:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208267#M19340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For any call stacks that you initiate then I guess standard try/catch should work, depending on my previous post i.e. it's no use if the exception isn't allowed to propagate to your catch!&amp;nbsp; (usual best practices apply)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For call stacks initiated from within the API is a different matter...hopefully one of the team can give us an insight into the approach they have employed...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 20:14:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208267#M19340</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2012-11-14T20:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to trap API-level errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208268#M19341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For any call stacks that you initiate then I guess standard try/catch should work&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, I'll give that a go. In some cases though these errors may originate from run-time events which I can't predict now, which is why I'm hoping for a map-level onError event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 21:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-trap-api-level-errors/m-p/208268#M19341</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-11-14T21:14:50Z</dc:date>
    </item>
  </channel>
</rss>

