UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

33 lines (32 loc) 1.49 kB
import { BaseError, type BaseErrorOptions } from "./BaseError.js"; /** Options for a `RequestError` */ interface RequestErrorOptions extends BaseErrorOptions { code?: number; } /** Error thrown when a request isn't well-formed. */ export declare class RequestError extends BaseError { /** The corresponding HTTP status code for this error, in the range `400-499` */ code: number; constructor(message?: string, options?: RequestErrorOptions); } /** Thrown 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 { readonly code: number; constructor(message?: string, options?: RequestErrorOptions); } /** Thrown if the requested content is not found. */ export declare class NotFoundError extends RequestError { readonly code = 404; constructor(message?: string, options?: RequestErrorOptions); } /** Error thrown when a request is is valid and well-formed, but its actual data is not. */ export declare class UnprocessableError extends RequestError { readonly code: number; constructor(message?: string, options?: RequestErrorOptions); } /** Thrown 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 { readonly code: number; constructor(message?: string, options?: RequestErrorOptions); } export {};