@ima/core
Version:
IMA.js framework for isomorphic javascript application
42 lines • 1.13 kB
TypeScript
import { IMAError } from './Error';
export type GenericErrorParams = {
cause?: Error | string;
status?: number;
[key: string]: unknown;
};
/**
* Implementation of the {@link Error} interface, providing more advanced
* error API.
*
* @extends Error
*/
export declare class GenericError<T = unknown> extends IMAError {
protected _params: T & GenericErrorParams;
/**
* Initializes the generic IMA error.
*
* @param message The message describing the cause of the error.
* @param params A data map providing additional
* details related to the error. It is recommended to set the
* `status` field to the HTTP response code that should be sent
* to the client.
*/
constructor(message: string, params?: T & GenericErrorParams);
/**
* @inheritDoc
*/
getHttpStatus(): number;
/**
* @inheritDoc
*/
getParams(): T & GenericErrorParams;
/**
* @inheritDoc
*/
isClientError(): boolean;
/**
* @inheritDoc
*/
isRedirection(): boolean;
}
//# sourceMappingURL=GenericError.d.ts.map