SmartAssembly 7

Help for older versions available.

These pages cover SmartAssembly 7, which is not the latest version. Help for other versions is also 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 assembly %ProgramFiles%\Red Gate\SmartAssembly 7\SDK\bin\SmartAssembly.ReportException.dll (this dependency will be removed when processed).

    For .NET Core applications, you should use .NET Standard version of the SDK assembly, located in: %ProgramFiles%\Red Gate\SmartAssembly 7\SDK\bin\SmartAssembly.ReportException_NetStandard.dll

  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?