All errors from .NET applications are automatically captured by Atatus. If you wish to report errors manually, you can do either by CaptureError() or CaptureException() method.

1. CaptureError

When you don't have an exception instance, you can report an error with this method.

Syntax

Agent.Atatus.CaptureError(error)

Parameter

Parameter Type Description
error String (Required) Error message.

Example

copy
icon/buttons/copy
using Atatus;

Agent.Atatus.CaptureError("Unable to make a payment!");

2. CaptureException

When you have an exception instance, you can report error with this method.

Syntax

Agent.Atatus.CaptureException(exception)

Parameter

Parameter Type Description
exception Exception Object (Required) Exception instance.

Example

copy
icon/buttons/copy
using Atatus;

try
{

    // Your code here

}
catch (Exception e)
{
    Agent.Atatus.CaptureException(e);

    // Handle exception
}