503 error (temporarily unavailable) does not throw a layer's onError event

1223
1
07-25-2012 04:47 PM
StephenLead
Regular Contributor III
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 onError event.

I'm finding that this isn't firing when the layer returns a ""NetworkError: 503 Service Temporarily Unavailable" error.

To illustrate, try this:

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");});


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).

[ATTACH=CONFIG]16403[/ATTACH]

I get a 503 message displayed in the Firebug console, but the layer's onError event does not fire.

[ATTACH=CONFIG]16404[/ATTACH]

Thanks,
Steve
0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: stevel

<bump>

(still an issue, possibly got overlooked during the busy UC period......)
0 Kudos