waifuim
    Preparing search index...

    Class ApiError

    Represents an error response from the API when the status code is not 200.

    Hierarchy

    • Error
      • ApiError
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Constructs an error from the given response and reason.

      Parameters

      • response: Response

        The original response

      • detail: string

        The error message from the API.

      Returns ApiError

    Properties

    cause?: unknown
    message: string
    name: string
    response: Response

    The original response object.

    stack?: string

    Accessors

    • get status(): number

      Get the status code of this error. e.g 404, 403, 401, 400

      Returns number

    • get statusText(): string

      Get the status message of this error. e.g "Not Found", "Forbidden", "Unauthorized", "Bad Request"

      Returns string

    Methods

    • Indicates whether the argument provided is a built-in Error instance or not.

      Parameters

      • error: unknown

      Returns error is Error