/** * Error with enforced error Code and status Code and autogenerated error ID uuid. */ declare class ErrorCustom extends Error { errorCode: number; statusCode: number; manuallyThrown: boolean; id: string; innerException: any; /** * Error Constructor * * Calls parent constructor to set the error message and * adds code, errorCode, manuallyThrown and innerException custom properties. * Logs the final object using passed function or debug library. * * @constructor * @param {string} message * Error message to set on the Error object * * @param {number} statusCode * HTTP status code * * @param {number} errorCode * The specific error code as defined in documentation * * @param {Error} baseError * Optional base exception to be included as innerException property * * @param {string | Function} logFunction * Optional function to log the error with. If not supplied, debug library will be used * to log to the console with the tag `error-custom` */ constructor(message: string, statusCode: number, errorCode: number, baseError?: Error, logFunction?: string | Function); /** * Standard method for providing JSON. * It actually returns an object, but this version can be serialized properly. */ toJSON(): {}; /** * The default logging behaviour for ErrorCustom * @param id * @param content */ private static defaultOutput; /** * Send the output to Elastic * @param node url to the node instance * @param id * @param content */ private static sendToElastic; } export default ErrorCustom;