UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

29 lines (28 loc) 1.39 kB
import { BaseError, type BaseErrorOptions } from "./BaseError.js"; /** Options for `RequestError`. */ interface RequestErrorOptions extends BaseErrorOptions { readonly code?: number; } /** Throw when a request isn't well-formed or is unacceptable in some way. */ export declare class RequestError extends BaseError { /** HTTP status code for this error, in the range `400-499` */ readonly code: number; constructor(message?: string, options?: RequestErrorOptions); } /** Throw if an operation failed because the user is not logged in, or the login information is not well-formed. */ export declare class UnauthorizedError extends RequestError { constructor(message?: string, options?: RequestErrorOptions); } /** Throw if the requested content is not found. */ export declare class NotFoundError extends RequestError { constructor(message?: string, options?: RequestErrorOptions); } /** Throw when a request is valid and well-formed, but its actual data is not. */ export declare class UnprocessableError extends RequestError { constructor(message?: string, options?: RequestErrorOptions); } /** Throw if an operation failed because the user is logged in, but does not have sufficient privileges to access this content. */ export declare class ForbiddenError extends RequestError { constructor(message?: string, options?: RequestErrorOptions); } export {};