Chat Support
Loupe - Log - Monitor - Resolve
Loupe / Developer's Guide / For .NET Framework / For WinForms / Developer's Guide for WinForms - Exception Handling
In This Topic
    Developer's Guide for WinForms - Exception Handling
    In This Topic

    In any application, runtime errors are going to happen eventually.  The Loupe Agent works within the capabilities of the .NET framework to attempt to provide the best user experience possible when there are problems.  For a general discussion on runtime errors in .NET, see Developer's Guide - Exception Handling - Unhandled Exceptions in .NET.

    Default Agent Behavior

    The Loupe Error Manager connects up to the .NET exception events to log any unhandled exception before the application can exit.

    Because of the internal architecture of Windows Forms applications it's possible for the Agent to intelligently handle runtime exceptions without the application being forced to exit by the .NET runtime.  By default, when an exception is thrown in your application that isn't handled by your code the Agent will catch it and display a user friendly dialog to the end user giving them the option of continuing execution or restarting the application.  This dialog is also designed to offer extended options to suppress future problems in the current session (which is particularly handy when errors are cascading as a user is trying to save and exit) and submit session data to you at the end of the session.

    Exception Notification vs. Handling

    The AppDomain.UnhandledException event is not an exception handler but rather an event that notifies you that an exception has occurred.  Once the event handler returns, the .NET runtime will end the process, potentially displaying a crash dialog to the end user.

    Submitting Session Data on an Exception

    You can use the Packager Dialog built into the Agent to have all of the session data up through and including the exception packaged and emailed to you for support.  For full details on how to use the Packager Dialog, see Getting Started - Packager Dialog.

    Integrating with your own Custom Exception Handling

    The Loupe Agent is designed to be integrated with your own exception handling strategy in any .NET application, letting you choose whether you want to just record or record and report exceptions to the user.  For more information, see Developer's Guide for WinForms - Exception Handling - Creating your own Custom Exception Handling.

    See Also