export declare type Info = Record; export interface Options { /** * Specifies arbitrary informational properties that are available through the * `ContextualError.info(err)` static class method. See that method for details. */ info?: Info; /** * Describes what kind of error this is. * This is intended for programmatic use to distinguish between different kinds of errors. * Note that in modern versions of Node.js, this name is ignored in the stack property value, * but callers can still use the name property to get at it. */ name?: string; /** * Prevent extending of message with cause chain. */ skipCauseMessage?: boolean; /** * If specified, then the stack trace for this error ends at function `constructorOpt`. * Functions called by `constructorOpt` will not show up in the stack. * This is useful when this class is subclassed. */ constructorOpt?: Function; } export declare const CERROR_SYMBOL: unique symbol; export declare class CError extends Error { readonly name: string; readonly message: string; readonly info: Info; /** * For debugging, we keep track of the original short message (attached * to this Error particularly) separately from the complete message, * which includes the messages of our cause chain. */ readonly shortMessage: string; /** * Indicates that the new error was caused by some other error */ private readonly cause?; constructor(message?: string, cause?: Error, options?: Options); toString(): string; toJSON(): Record; static isCError(obj: unknown): obj is CError; static cause(err: CError | Error): CError | Error | null; static info(err: CError | Error): Info; /** * Returns a string containing the full stack trace, with all nested errors recursively reported as 'caused by:' + err.stack. */ static fullStack(err: CError | Error): string; static findCauseByName(err: CError | Error, name: string): CError | Error | null; static hasCauseWithName(err: CError | Error, name: string): boolean; } export default CError;