@ingeze/api-error - v1.0.8
    Preparing search index...

    Class UnauthorizedError

    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 details object.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new UnauthorizedError instance with optional details.

      Parameters

      • Optionaldetails: Record<string, unknown>

        Additional error details related to the authentication failure.

      Returns UnauthorizedError

    • Creates a new UnauthorizedError instance with a custom message, type, and optional details.

      Parameters

      • Optionalmessage: string

        A custom error message describing the authentication issue.

      • Optionaltype: UnauthorizedErrorType

        A specific unauthorized error type identifier.

      • Optionaldetails: Record<string, unknown>

        Additional error details.

      Returns UnauthorizedError

    Properties

    details?: Record<string, unknown>

    Additional error details (optional).

    message: string

    Descriptive error message.

    statusCode: number

    HTTP status code associated with the error.

    success: boolean

    Indicates if the response was successful (always false for errors).

    type: string

    Error type.

    Methods