Table of Contents

Class ErrorReturnValue

Namespace
Utils.OData
Assembly
Utils.OData.dll

Represents an error returned by an OData operation.

public sealed record ErrorReturnValue : IEquatable<ErrorReturnValue>
Inheritance
ErrorReturnValue
Implements
Inherited Members
Extension Methods

Constructors

ErrorReturnValue(int, string)

Initializes a new ErrorReturnValue with the given code and message.

public ErrorReturnValue(int code, string message)

Parameters

code int

Application-specific or HTTP status code describing the failure.

message string

Human-readable explanation of the error. Must not be null or empty.

Exceptions

ArgumentException

Thrown when message is null, empty, or whitespace.

ErrorReturnValue(int, string, ODataErrorKind, int?)

Initializes a new ErrorReturnValue with a code, message, error category, and optional HTTP status.

public ErrorReturnValue(int code, string message, ODataErrorKind kind, int? httpStatusCode = null)

Parameters

code int

Application-specific or HTTP status code describing the failure.

message string

Human-readable explanation of the error. Must not be null, empty, or whitespace.

kind ODataErrorKind

The category of the error (item 31).

httpStatusCode int?

The HTTP status code associated with the failure, when applicable.

Exceptions

ArgumentException

Thrown when message is null, empty, or whitespace.

Properties

HttpStatusCode

Gets the HTTP status code associated with the failure when the error originates from an HTTP response; otherwise null (item 31).

public int? HttpStatusCode { get; }

Property Value

int?

Kind

Gets the category of the error, enabling callers to branch on the failure origin without interpreting the numeric code (item 31).

public ODataErrorKind Kind { get; }

Property Value

ODataErrorKind

code

Application-specific or HTTP status code describing the failure.

public int code { get; }

Property Value

int

message

Human-readable explanation of the error.

public string message { get; }

Property Value

string