///
/**
* Standard error to use. This contains a key, status code and info object.
* Mostly provided to make it easier to return errors from your API's.
*
* @since 0.1.0
* @class
*/
export class AppError extends Error {
/**
* @param {*} value
* @returns {value is AppError}
*/
static instanceOf(value: any): value is AppError;
/**
* @param {Record} [info={}]
* @param {Error} [error]
* @returns {AppError}
*/
static notFound(
info?: Record | undefined,
error?: Error | undefined,
): AppError;
/**
* @param {Record} [info={}]
* @param {Error} [error]
* @returns {AppError}
*/
static notImplemented(
info?: Record | undefined,
error?: Error | undefined,
): AppError;
/**
* @param {Record} [info={}]
* @param {Error} [error]
* @returns {AppError}
*/
static serverError(
info?: Record | undefined,
error?: Error | undefined,
): AppError;
/**
* @param {string} key
* @param {Record} [info={}]
* @param {Error} [error]
* @returns {AppError}
*/
static validationError(
key: string,
info?: Record | undefined,
error?: Error | undefined,
): AppError;
/**
* Format any error skipping the stack automatically for nested errors
*
* @param {AppError|Error|undefined|null|{}|string|number|boolean|function} [e]
* @returns {Record}
*/
static format(
e?:
| AppError
| Error
| undefined
| null
| {}
| string
| number
| boolean
| Function,
): Record;
/**
* @param {string} key
* @param {number} status
* @param {Record} [info={}]
* @param {Error} [originalError]
*/
constructor(
key: string,
status: number,
info?: Record | undefined,
originalError?: Error | undefined,
);
key: string;
status: number;
info: Record;
originalError: Error | undefined;
/**
* Use AppError#format when AppError is passed to JSON.stringify().
* This is used in the compas insight logger in production mode.
*/
toJSON(): Record;
/**
* Use AppError#format when AppError is passed to console.log / console.error.
* This works because it uses `util.inspect` under the hood.
* Util#inspect checks if the Symbol `util.inspect.custom` is available.
*/
[inspect.custom](): Record;
}
import { inspect } from "util";
//# sourceMappingURL=error.d.ts.map