Table of Contents

Class ErrorReport

Namespace
NanoByte.Common
Assembly
NanoByte.Common.dll

Wraps information about a crash in a serializer-friendly format.

public sealed class ErrorReport
Inheritance
object
ErrorReport
Extension Methods

Properties

Application

Information about the current application.

public required AppInfo Application { get; set; }

Property Value

AppInfo

Comments

Comments about the crash entered by the user.

public string? Comments { get; set; }

Property Value

string

Exception

Information about the exception that occurred.

public ExceptionInfo? Exception { get; set; }

Property Value

ExceptionInfo

Log

The contents of the Log file.

public string? Log { get; set; }

Property Value

string

OS

Information about the current operating system.

public required OSInfo OS { get; set; }

Property Value

OSInfo

Methods

Generate(Exception, string)

Generates an error report.

public static ErrorReport Generate(Exception exception, string comments)

Parameters

exception Exception

The exception that occurred.

comments string

Comments about the crash entered by the user.

Returns

ErrorReport

SendAsync(Uri)

Sends the error report to a remote server.

[RequiresDynamicCode("XML serialization requires runtime code generation.")]
public Task<string> SendAsync(Uri uri)

Parameters

uri Uri

The URI to send the report to.

Returns

Task<string>

The response from the server, if any. May contain instructions how to mitigate the error.

ShouldReport(Exception)

Determines whether an exception should be reported.

public static bool ShouldReport(Exception exception)

Parameters

exception Exception

Returns

bool

ToXmlStringAnonymized()

Serializes the error report to an XML string, removing user-specific information.

[RequiresDynamicCode("XML serialization requires runtime code generation.")]
public string ToXmlStringAnonymized()

Returns

string