SmartAssembly 8

Help for older versions available.

Reporting handled exceptions

Once enabled, Automatic Error Reporting intercepts all unhandled exceptions and reports them to you automatically. 

If required you can also report handled exceptions. 

To report a handled exception:

  1. Reference the RedGate.SmartAssembly.ReportException NuGet package (this dependency will be removed when processed).

  2. For any public method that can throw an exception which you wish to report, create a try-catch block and add a call to ExceptionReporting.Report as follows: 

    1. using SmartAssembly.ReportException;
    2. public class MyClass
    3. {
    4. public bool DoSomething()
    5. {
    6. try
    7. {
    8. DoSomethingInternal();
    9. return true;
    10. }
    11. catch (Exception exception)
    12. {
    13. ExceptionReporting.Report(exception);
    14. return false;
    15. }
    16. }
    17. }
  3. The error reporting dialog box is shown (unless the Automatic template is enabled).
  4. The program continues after the exception has been reported.

Didn't find what you were looking for?