UNPKG

@ayonli/jsext

Version:

A JavaScript extension package for building strong and modern applications.

71 lines (70 loc) 2.3 kB
/** * This module includes some common errors that can be used in the application. * @module */ import Exception from "./Exception.ts"; /** * This error indicates that the requested operation, such as modifying a file, * is not allowed by the current user. * * NOTE: This error has an HTTP-compatible code of `403`. */ export declare class NotAllowedError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the requested resource, such as a file, is not * found. * * NOTE: This error has an HTTP-compatible code of `404`. */ export declare class NotFoundError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the target resource path, such as a file, already * exists. * * NOTE: This error has an HTTP-compatible code of `409`. */ export declare class AlreadyExistsError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the requested function or feature is not supported * by the current environment. * * NOTE: This error has an HTTP-compatible code of `405`. */ export declare class NotSupportedError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the requested operation, such as a function, is not * implemented. * * NOTE: This error has an HTTP-compatible code of `501`. * * NOTE: `NotImplementedError` should only be used for stubs or placeholders, * it should not be used to indicate the lack of support for a feature, in such * cases, use {@link NotSupportedError} instead. */ export declare class NotImplementedError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the requested operation, such as a network request, * is timed out. * * NOTE: This error has an HTTP-compatible code of `408`. */ export declare class TimeoutError extends Exception { constructor(message: string, options?: ErrorOptions); } /** * This error indicates that the connection between the client and the server * cannot be established. */ export declare class NetworkError extends Exception { constructor(message: string, options?: ErrorOptions); }