UNPKG

@amadeus-it-group/kassette

Version:

Development server, used mainly for testing, which proxies requests and is able to easily manage local mocks.

36 lines (35 loc) 1.09 kB
/** * Application custom errors. */ /** The id of the error type. */ export type TYPE = 'file_configuration' | 'server_error' | 'missing_remote_url'; /** * The base type for all custom application errors; * stores the `original` error, if any (otherwise returns `null`). */ export declare class AppError extends Error { readonly original: Error | null; readonly type: TYPE; constructor(original: Error | null, type: TYPE, message: string); } /** * Tells if the given value is an application error. */ export declare const isAppError: (error: any) => error is AppError; /** * @param original The original file access error * @param path The path of the configuration file */ export declare class FileConfigurationError extends AppError { readonly path: string; constructor(original: Error, path: string); } /** * @param original The original error thrown when starting the server. */ export declare class ServerError extends AppError { constructor(original: Error); } export declare class MissingRemoteURLError extends AppError { constructor(); }