Class ErrorReturnValue
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
codeintApplication-specific or HTTP status code describing the failure.
messagestringHuman-readable explanation of the error. Must not be null or empty.
Exceptions
- ArgumentException
Thrown when
messageis 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
codeintApplication-specific or HTTP status code describing the failure.
messagestringHuman-readable explanation of the error. Must not be null, empty, or whitespace.
kindODataErrorKindThe category of the error (item 31).
httpStatusCodeint?The HTTP status code associated with the failure, when applicable.
Exceptions
- ArgumentException
Thrown when
messageis 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
code
Application-specific or HTTP status code describing the failure.
public int code { get; }
Property Value
message
Human-readable explanation of the error.
public string message { get; }