Manual reporting

Most of our client libraries detect and report unhandled exceptions. But sometimes you have your own try/catch blocks. In those you need to manually report errors.

This guide aims to explain how.

The most basic way is simply to invke Err.Report():

try
{
    //some stuff that generates an exception
}
catch (Exception ex)
{
    Err.Report(ex);
}

You can also attach context information:

try
{
    //some stuff that generates an exception
}
catch (Exception ex)
{
    Err.Report(ex, yourContextData);
}

Using anonymous object

If you need to attach multiple values you can use an anonymous object:

try
{
    //some stuff that generates an exception
}
catch (Exception ex)
{
    Err.Report(ex, new { UserId = userId, UserState = state });
}

Result

Complex structures are supported.

Creating custom context collections

You can also create custom context collections which will be automatically included with every error report.

Read more

Edit page at GitHub Create a documentation ticket Ask a question This page is generated using the open source project MarkdownWeb.