Creates a new UnauthorizedError instance with optional details.
Optionaldetails: Record<string, unknown>Additional error details related to the authentication failure.
Creates a new UnauthorizedError instance with a custom message, type, and optional details.
Optionalmessage: stringA custom error message describing the authentication issue.
Optionaltype: UnauthorizedErrorTypeA specific unauthorized error type identifier.
Optionaldetails: Record<string, unknown>Additional error details.
OptionaldetailsAdditional error details (optional).
Descriptive error message.
HTTP status code associated with the error.
Indicates if the response was successful (always false for errors).
Error type.
Converts the error instance to a JSON object compatible with the ErrorResponse interface.
Serializable error object.
Represents a generic unauthorized error (HTTP 401).
This error is thrown when the request requires user authentication but the client has failed to provide valid credentials.
Can be instantiated with either a custom message, type, and optional details, or directly with a
detailsobject.