/** * Various utilities to work with errors. */ export declare class ErrorUtil { /** * Customize the given error with the additional given message. A new Error will be returned. * * @param {Error | string} e * @param {string} message * @returns {Error} */ static customize(e: Error | string, message: string): Error; /** * Stringifies an object including Errors (which cannot be stringified with JSON.stringify). * * @param obj * @returns {string} */ static stringify(obj: any): string; /** * Gets a developer-friendly string from an Error that can be printed out into the console or in the logs. * * @param {Error | string} messageOrError * @returns {string} */ static getPrintableError(messageOrError: Error | string): string; /** * Gets the name of a class or an object that can be used in Error objects and for debugging purposes. * * @param objectOrPrototype * @returns {string} */ static getDebugName(objectOrPrototype: any): string; /** * Logs any uncaught exceptions and unhandled promise rejections. * * Generally, it is a bad practice to just log uncaught errors and move on. It is recommended that, in a server * environment, you supply a callback that when called will prevent any new server requests and drain the current * connections, and finally do a process.exit(1). */ static logUncaughtExceptionsAndUnhandledRejections(callback?: (thrown: any) => void): void; /** * Makes sure Errors can be serialized. * * @param obj * @returns {object} */ private static recursivePropertyFinder; }