Select to view content in your preferred language

Graceful recovery from layer LOAD_ERROR faults

1974
2
07-17-2012 08:27 AM
AndrewLiles
Emerging Contributor
Is the best way to recover from a LOAD_ERROR fault (on an ArcGISDynamicMapServiceLayer, for instance) involve creating a whole new layer object? Or is there some method on the class that allows one to attempt a reload in-place? A lookover of the API docs lead me to think that there is no way to "reload" a faulted layer in place.

We're loading a fairly large number of layers and some of our clients are on less-than-ideal internet connections, so occurrences of load faults are higher than I'd like. To address this I'm adding in some more error handling/retry options to more gracefully recover from these instances instead of simply splashing out error messages or removing the layer.
Tags (2)
0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
You can cause it to try and reload by changing the url by appending a dummy parameter to it.
0 Kudos
AustinDavis
Occasional Contributor
Have you tried casting it to a Layer and calling the refresh() method on it. This should reload the Layer.
0 Kudos