InvergeDocs
.NETAPI reference

Errors

Errors in the .NET SDK.

ErrorsResource

class
class Inverge.Nexus.Resources.ErrorsResource

Error monitoring — report exceptions and error conditions.

Fingerprint()

static method
static string Fingerprint(Exception exception)

A stable grouping key: the exception type plus the deepest frame that threw.

Use it when two genuinely different failures share a message, or when a message varies per request and would otherwise create an issue per call.

Parameters

Prop

Type

Returns string

StackFrames()

static method
static IReadOnlyList<NexusStackFrame> StackFrames(Exception exception, int limit = 100)

Normalised stack frames for an exception, innermost first — the order the console reads, so the first line is where it broke.

Parameters

Prop

Type

Returns IReadOnlyList<NexusStackFrame>

CaptureAsync()

method
Task<ErrorCaptureResult> CaptureAsync(string message, string? type = null, string? level = null, bool? handled = null, string? fingerprint = null, IEnumerable<NexusStackFrame>? stack = null, object? errorContext = null, NexusTelemetryContext? context = null, CancellationToken cancellationToken = default)

Reports an error by message.

Parameters

Prop

Type

Returns Task<ErrorCaptureResult>

CaptureExceptionAsync()

method
Task<ErrorCaptureResult> CaptureExceptionAsync(Exception exception, bool handled = true, string? level = "error", string? fingerprint = null, bool includeInner = true, object? errorContext = null, NexusTelemetryContext? context = null, CancellationToken cancellationToken = default)

Reports a caught exception, with its type, message and stack.

try { await ChargeAsync(order); }
catch (PaymentException ex)
{
    await nexus.Errors.CaptureExceptionAsync(ex, errorContext: new { order = order.Id });
}

Parameters

Prop

Type

Returns Task<ErrorCaptureResult>

On this page