API

Storing handled exceptions

To record exceptions handled by a try-catch block, use RevDeBugAPI.Snapshot.RecordException and pass the exception object as a parameter. For example:
1
try
2
{
3
var product = new Product();
4
product.convertData(dataFile);
5
}
6
catch (Exception e){
7
// The exception will be recorded by RevDeBug
8
RevDeBugAPI.Snapshot.RecordException(e);
9
}
Copied!
The recorded snapshot of code execution that led to the exception will be stored on a Recording Server and visible on RevDeBug DevOps Monitoring dashboard in the same manner unhandled exceptions are.

Recordings of complex objects

To record inside an object of any class use RevDeBugAPI.RecordObject(object). This function records the interior of the object at a given moment of the program operation.
1
var product = new Product();
2
product.convertData(dataFile);
3
4
// The object will be recorded by RevDeBug
5
RevDeBugAPI.RecordObject(product);
Copied!

Using the RecordSnapshot function

RevDeBug offers the possibility to create code recordings even when there is no unexpected exception. To use the function of creating snapshots, you should use the RevDeBugAPI.Snapshot.RecordSnapshot(RecordingName) function anywhere in the program code. The place in the code where we used the snapshot function will be the end of the recording.
1
var product = new Product();
2
product.convertData(dataFile);
3
4
// The above states will be recorded
5
RevDeBugAPI.Snapshot.RecordSnapshot("Recording");
Copied!