<?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 503 error (temporarily unavailable) does not throw a layer's onError event in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/503-error-temporarily-unavailable-does-not-throw-a/m-p/105127#M9652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to trap for the situation when an ArcGIS Server service isn't available because the server is down, so I'm trying to listen for the layer's &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;I'm finding that this isn't firing when the layer returns a ""NetworkError: 503 Service Temporarily Unavailable" error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To illustrate, try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_Worl/MapServer");
map.addLayer(layer);
dojo.connect(layer, "onError", function() {console.log("problem with layer");});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will display the message, since that layer doesn't exist on that server (I removed the D from WORLD). Now try replacing that URL with a service which does exist but which isn't currently running (ie, if you tried to open its URL in a web browser you'd see a 503 error).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16403[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a 503 message displayed in the Firebug console, but the layer's onError event does not fire.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16404[/ATTACH]&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>Sat, 11 Dec 2021 06:25:18 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2021-12-11T06:25:18Z</dc:date>
    <item>
      <title>503 error (temporarily unavailable) does not throw a layer's onError event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/503-error-temporarily-unavailable-does-not-throw-a/m-p/105127#M9652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to trap for the situation when an ArcGIS Server service isn't available because the server is down, so I'm trying to listen for the layer's &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;I'm finding that this isn't firing when the layer returns a ""NetworkError: 503 Service Temporarily Unavailable" error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To illustrate, try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_Worl/MapServer");
map.addLayer(layer);
dojo.connect(layer, "onError", function() {console.log("problem with layer");});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will display the message, since that layer doesn't exist on that server (I removed the D from WORLD). Now try replacing that URL with a service which does exist but which isn't currently running (ie, if you tried to open its URL in a web browser you'd see a 503 error).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16403[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a 503 message displayed in the Firebug console, but the layer's onError event does not fire.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16404[/ATTACH]&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>Sat, 11 Dec 2021 06:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/503-error-temporarily-unavailable-does-not-throw-a/m-p/105127#M9652</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-11T06:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: 503 error (temporarily unavailable) does not throw a layer's onError event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/503-error-temporarily-unavailable-does-not-throw-a/m-p/105128#M9653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: stevel&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;bump&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(still an issue, possibly got overlooked during the busy UC period......)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 01:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/503-error-temporarily-unavailable-does-not-throw-a/m-p/105128#M9653</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-08-07T01:13:19Z</dc:date>
    </item>
  </channel>
</rss>

