As the UI of a phone is somewhat different than a traditional “interface” (i.e. a PC); you have to apply different approaches when it comes to displaying errors to the user.
In the “normal world” – e.g. a web application has a common error page that you lead your users to when something unfortunate happens. This is setup in web.config as a dedicated page for errors. On the Windows Phone, you can re-use that concept and have a common error page. Not that it is setup in app.config; but it is a common page you use for displaying “human readable” error messages to the user. The concept is seen here:
When an unhandled exception has happened; this is caught in the App (Application) and the Application is redirected to the error page (ErrorView). The below is taken from App.xaml.cs and presents the Application_UnhandledException method. This is by default hooked up in the constructor of the App-class.
// Code to execute on Unhandled Exceptions
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
// An unhandled exception has occurred; break into the debugger
//is handled by this method.
e.Handled = true;
//route to error view
Dictionary<string,string> data = new Dictionary<string,string>();
As seen, then an unhandled exception is caught in the App class, the Exception is set to Handled = true and the ApplicationController is used for navigating to the ErrorView. This will then be presented to the User as a common error page. What happens next, is the responsibility of the developer and your application context ;-)