
Unhandled Exception Processing
During the lifetime of your application, unanticipated situations might occur that cause the Silverlight plug-in to throw an exception. Although you can catch exceptions in your application code, you might not be able to anticipate all potential exceptions.
Unhandled exceptions will cause the Silverlight plug-in to stop running in the browser. To prevent this from occurring, handle the Application..::.UnhandledException event. You can use the event data to determine whether the exception is recoverable. If you can recover from the exception, set the ApplicationUnhandledExceptionEventArgs..::.Handled property to true.
If you do not handle the exception in your managed code, the Silverlight plug-in onError event occurs. This gives you one final opportunity to handle the exception by using JavaScript in the host Web page. The onError event provides access to plug-in error codes, which can be useful for debugging purposes. For more information, see Debugging, Error Handling, and Exceptions. For error code information, see Silverlight Plug-in Error Messages.