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
errorCodestringThe error code.
errorDescriptionstringThe error description.
argsobject[]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
errorCodestringThe error code.
errorDescriptionstringThe error description.
argsobject[]The error description format arguments./
errorUristringThe error URI.
requestIdstringThe 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
ErrorDescription
The error_description.
[JsonPropertyName("error_description")]
public string ErrorDescription { get; set; }
Property Value
ErrorUri
The error_uri.
[JsonPropertyName("error_uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ErrorUri { get; set; }
Property Value
RequestId
The request identifier request_id.
[JsonPropertyName("request_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? RequestId { get; set; }
Property Value
Methods
FormatDescription()
Format the ErrorDescription with the Args.
public string FormatDescription()
Returns
- string
Formatted error description.
FormatError()
Creates a new Error instance with formatted ErrorDescription with the Args.
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)