Table of Contents

Class Error

Namespace
OneImlx.Shared.Infrastructure
Assembly
OneImlx.Shared.dll

The generic error.

public sealed class Error
Inheritance
Error
Inherited Members

Constructors

Error()

Initializes a new instance.

public Error()

Error(string, string, params object?[])

Initialize a new instance.

public Error(string errorCode, string errorDescription, params object?[] args)

Parameters

errorCode string

The error code.

errorDescription string

The error description.

args object[]

The error description format arguments.

Error(string, string, object?[]?, string?, string?)

Initialize a new instance.

public Error(string errorCode, string errorDescription, object?[]? args = null, string? errorUri = null, string? requestId = null)

Parameters

errorCode string

The error code.

errorDescription string

The error description.

args object[]

The error description format arguments./

errorUri string

The error URI.

requestId string

The request id.

Properties

Args

The error description format arguments.

[JsonPropertyName("args")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public object?[]? Args { get; set; }

Property Value

object[]

ErrorCode

The error_code code.

[JsonPropertyName("error_code")]
public string ErrorCode { get; set; }

Property Value

string

ErrorDescription

The error_description.

[JsonPropertyName("error_description")]
public string ErrorDescription { get; set; }

Property Value

string

ErrorUri

The error_uri.

[JsonPropertyName("error_uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ErrorUri { get; set; }

Property Value

string

RequestId

The request identifier request_id.

[JsonPropertyName("request_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? RequestId { get; set; }

Property Value

string

Methods

FormatDescription()

Format the ErrorDescription with the Args.

[WriteUnitTest]
public string FormatDescription()

Returns

string

Formatted error description.

FormatError()

Creates a new Error instance with formatted ErrorDescription with the Args.

[WriteUnitTest]
public Error FormatError()

Returns

Error

Formatted error instance.

SetError(string, string, object?[]?, string?, string?)

Set an error.

public void SetError(string errorCode, string errorDescription, object?[]? args = null, string? errorUri = null, string? requestId = null)

Parameters

errorCode string
errorDescription string
args object[]
errorUri string
requestId string