Class Error
The Error class encapsulates the details of an error that occurs within the SDK. It has attributes: Code and Message. The Code represents a value that indicates the type of error, while the Message is a string that provides a human-readable description of the error.
note
The Error class is intended to be used internally within the SDK.
public sealed class Error : IEquatable<Error>
- Inheritance
-
Error
- Implements
- Inherited Members
Constructors
Error(string, string)
The Error class encapsulates the details of an error that occurs within the SDK. It has attributes: Code and Message. The Code represents a value that indicates the type of error, while the Message is a string that provides a human-readable description of the error.
note
The Error class is intended to be used internally within the SDK.
public Error(string code, string message)
Parameters
Fields
None
A static field that represents an empty error with no code or message.
public static readonly Error None
Field Value
Properties
Code
Gets the string representation of the code that indicates the type of error.
public string Code { get; }
Property Value
Message
Gets the string representation of the error that provides human-readable description.
public string Message { get; }
Property Value
Methods
Equals(object?)
Determines whether the current Error object is equal to a specified object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
- bool
true
if the current object and obj are both Error objects and have the same value; otherwise,false
.
Equals(Error?)
Determines whether the current Error object is equal to another Error object.
public bool Equals(Error? other)
Parameters
other
ErrorThe Error object to compare with the current object.
Returns
- bool
true
if the current object and other have the same value; otherwise,false
.
GetHashCode()
Returns the hash code for the current Error object.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
ToString()
Returns a string that represents the current Error object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(Error?, Error?)
Determines whether two Error objects have the same value.
public static bool operator ==(Error? lhs, Error? rhs)
Parameters
Returns
- bool
true
if lhs and rhs have the same value; otherwise,false
.
implicit operator string(Error)
Converts an Error object to a string representation.
public static implicit operator string(Error error)
Parameters
error
ErrorThe Error object to convert.
Returns
- string
A string that represents the error.
operator !=(Error?, Error?)
Determines whether two Error objects have different values.
public static bool operator !=(Error? lhs, Error? rhs)
Parameters
Returns
- bool
true
if lhs and rhs have different values; otherwise,false
.