Table of Contents

Class ResultProblem

Namespace
Olve.Results
Assembly
Olve.Results.dll

Represents a problem encountered during an operation.

public class ResultProblem
Inheritance
ResultProblem
Inherited Members

Constructors

ResultProblem(Exception, string, params object[])

Initializes a new instance of the ResultProblem class from an Exception.

public ResultProblem(Exception exception, string message, params object[] args)

Parameters

exception Exception

The exception that caused the problem, if any.

message string

The message describing the problem.

args object[]

Optional arguments providing additional details about the problem.

ResultProblem(string, params object[])

Initializes a new instance of the ResultProblem class.

public ResultProblem(string message, params object[] args)

Parameters

message string

The message describing the problem.

args object[]

Optional arguments providing additional details about the problem.

Fields

DefaultPrintDebug

Gets or sets the default value indicating whether to print debug information.

public static bool DefaultPrintDebug

Field Value

bool

DefaultSeverity

Gets or sets the default severity level of the problem.

public static int DefaultSeverity

Field Value

int

DefaultSource

Gets or sets the default source of the problem, if any.

public static string? DefaultSource

Field Value

string

DefaultTags

Gets or sets the default tags categorizing the problem.

public static string[] DefaultTags

Field Value

string[]

Properties

Args

Gets the optional arguments providing additional details about the problem.

public object[] Args { get; }

Property Value

object[]

Exception

Gets the exception that caused the problem, if any.

public Exception? Exception { get; }

Property Value

Exception

Message

Gets the message describing the problem.

public string Message { get; }

Property Value

string

OriginInformation

Gets the origin information of the problem.

public ProblemOriginInformation OriginInformation { get; }

Property Value

ProblemOriginInformation

Severity

Gets the severity level of the problem, where higher values indicate more severe problems. The default value can be set using DefaultSeverity.

public int Severity { get; init; }

Property Value

int

Source

Gets the source of the problem, if any. The default value can be set using DefaultSource.

public string? Source { get; init; }

Property Value

string

Tags

Gets the optional tags categorizing the problem. The default value can be set using DefaultTags.

public string[] Tags { get; init; }

Property Value

string[]

Methods

ToBriefString()

Formats the problem as a string for brief display, omitting references to code locations.

public string ToBriefString()

Returns

string

The formatted string.

ToDebugString()

Formats the problem as a string for debugging purposes.

public string ToDebugString()

Returns

string

The formatted string.

ToString()

Formats the problem as a string. If DefaultPrintDebug is true, ToDebugString() is used; otherwise, ToBriefString() is used.

public override string ToString()

Returns

string

The formatted string.