Sunday, March 17, 2013

Azure Mobile Services error: "The request could not be completed. ()"

Having just published my first (Windows Phone - obviously) app using Azure Mobile Services, I thought I'd share something I learnt in the process. When first testing on an actual device (always test on actual devices!) I hit an issue where the MobileServicesClient was failing with the following message being intercepted by the Application level UnhandledExceptionHandler:
"The request could not be completed. ()"

Notice the empty brackets at the end. In most cases (based on similar exceptions that others have reported and Google helped me find) these would include an indicator of the issue. Such as "(Internal Server Error)" or "(Send failure)".

The call stack wasn't much help either:


   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.CreateMobileServiceException(String errorMessage, IServiceFilterRequest request, IServiceFilterResponse response)
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.ThrowInvalidResponse(IServiceFilterRequest request, IServiceFilterResponse response, JToken body)
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.<RequestAsync>d__f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.<SendInsertAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<InsertAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at RadioNow.MainPage.<OnNavigatedTo>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)


Even when I wrapped all my uses of the client in try..catch blocks this exception was still only getting caught at the application level unhandled exception handler.

Anyway, the issue came down to the devicenot having Wi-Fi enabled and for some reason it wasn't using 3G ro USB passthrough to connect instead.

So, 2 lessons:
1. The WP8 AMS client might throw errors, based on connectivity, that you'll have to catch and deal with at an application level.
2. Be sure to check/test Wi-Fi connections on devices when tethered.



3 comments:


  1. Nowadays it may implicate either a stop by at a jewelry expert and / or hometown Gucci keep and / or you would attend to omega replica sale the job one self. Switching typically the follow variety can be described as hassle-free chore. The relationship from a variety is invariably comparatively rather long which means this really a common existence. Typically the variety is definitely not a low-cost device to find, nevertheless it really might be relative to the beauty from chanel replica typically the follow. There can be two to three styles of patterns for the purpose of Gucci looks after many can include mechanical, quartz not to mention bracelet not to mention dependant on the sort bought an important particular variety could be vital. Such electrical power are generally choose over the internet and / or using a Gucci stow. That is the high-end trendy tag heuer replica uk follow as a consequence it's going to complex unpick the back of this claim to reach typically the variety. Should there can be any sort of situations suffered in the home . best to understand it properly replaces in order that this is not to injure typically the follow not to mention devalue it again. Numerous looks after have screws that might be used, some people cannot. There needs to be some sophisticated sadness privately from replica chanel the outcome that allows the back to always be unscrewed. And once this really undertaken there can be gasket 's who end up being detached and next typically the variety could be reachable. In case it is secure set accompanied by a stream maybe a twist it again may prefer to turn out to be detached accompanied by a screwdriver.

    ReplyDelete
  2. atlanta falcons, http://www.atlantafalconsjersey.us/
    michael kors outlet online, http://www.michaelkorsusa.us/
    mbt sneakers, http://www.mbtshoesoutlet.us.com/
    dallas cowboys, http://www.dallascowboysjersey.us/
    oklahoma city thunder, http://www.thunderjerseystore.com/
    san francisco 49ers, http://www.sanfrancisco49ersjerseys.us/
    cheap uggs, http://www.uggsale.in.net/
    polo ralph lauren uk, http://www.ralphlauren-outletonline.co.uk/
    chicago bulls, http://www.chicagobullsjerseys.net/
    babyliss hair dryer, http://www.babyliss.us.com/
    supra sneakershttp://www.suprashoes.us.com
    ray ban sunglasses, http://www.ray-bansunglasses.eu.com/
    toms shoes outlet online, http://www.toms.us.com/
    snapback hats, http://www.cheapsnapbacks.us.com/
    fitflop sandals, http://www.fitflop.in.net/
    louis vuitton outlet,louis vuitton outlet online,louis vuitton,louisvuitton.com,authentic louis vuitton,louis vuitton factory outlet,cheap louis vuitton
    ralph lauren sale, http://www.ralphlaurenoutlet.in.net/
    oakley outlet online, http://www.oakleyoutlet.in.net/
    kkk10 13

    ReplyDelete