ArcGISTiledMapServiceLayer - Unhandled Exceptions

2236
0
02-19-2016 12:02 PM
JimFiddes
Occasional Contributor

In our applicaton (XAML) we have wired up to listen for all unhandled exceptions and if we put our device into airplane mode to simulate loss of network connectivity we are getting several hundred errors messages (see message below) from the map. We have a single base map layer (type of layer is in the subject line) and it appears if we can't hit the service to get the tiles, we throw exceptions. Is there a proper way to handle having a map with an internet map service and loss of connectivity?

How we wire up to unhandled exceptions:

TaskScheduler.UnobservedTaskException += (s, e) => HandleUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException");

1 of the several hundred exceptions that we get (these exceptions are all thrown within a few seconds):

2016-02-19 11:30:21 AM:

An unhandled exception occurred of type TaskScheduler.UnobservedTaskException, System.AggregateException:

System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com'

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext()

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)

   at Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer.<>c__DisplayClass20.<<GetTileDataAsync>b__1f>d__22.MoveNext()

   --- End of inner exception stack trace ---

---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com'

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext()

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)

   at Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer.<>c__DisplayClass20.<<GetTileDataAsync>b__1f>d__22.MoveNext()

---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'services.arcgisonline.com'

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInternal.<SendAsync>d__2.MoveNext()<---

0 Kudos
0 Replies