Handled Exceptions

Learn how to record handled exceptions using Crash Recorder

Estimated reading time: 1 min

Last edited: 04 Nov 2019

Normally Crash Recorder mode will create a recording each time an unhandled exception occures. RevDeBug API expands this functionality and allows you to record in the same manner any handled exception.

Example - recording handled exceptions

The implementation is simple: just call RevDeBug.Api.CrashRecorder.Api.StoreException and pass the exception object as parameter. Here is an exmaple made on our Demo application. Where a simulated exception has been added.

MainWindow.xaml.cs

public MainWindow()
{
    try {
        InitializeComponent();
        var converter = new BrushConverter(); 
        RdbRedBrush = (Brush)converter.ConvertFromString("#b01f1c");
        throw new Exception(); /* to simulate the exception */;
    }
    catch(Exception e){
        RevDeBug.Api.CrashRecorder.Api.StoreException(e);
    }
}
  

Recording of this code execution will be stored on a RevDeBug Recording Server. You can access it with the use of RevDeBug DevOps Monitor or through RevDeBug IDE Extension. Monitor - code view