/** * @file Errors - CommandError * @module kronk/errors/CommandError */ import KronkError from '#errors/kronk.error'; import type { Command, CommandErrorInfo, CommandErrorSnapshot } from '@flex-development/kronk'; /** * A command error. * * @see {@linkcode KronkError} * * @category * errors * * @class * @extends {KronkError} */ declare class CommandError extends KronkError { /** * The command where the error originated. * * @see {@linkcode Command} * * @public * @instance * @member {Command | null} */ command: Command | null; /** * Create a new command error. * * @see {@linkcode Command} * @see {@linkcode CommandErrorInfo} * @see {@linkcode ExitCode} * @see {@linkcode KronkErrorCause} * * @param {CommandErrorInfo} info * Info about the error * @param {string | string[] | null | undefined} [info.additional] * Additional lines to be logged with the error * @param {KronkErrorCause | null | undefined} [info.cause] * Info about the cause of the error * @param {Command | null | undefined} [info.command] * The command where the error originated * @param {ExitCode | null | undefined} [info.code] * Suggested exit code to use with {@linkcode process.exit} * @param {string} info.id * Unique id representing the error * @param {string} info.reason * Human-readable description of the error */ constructor(info: CommandErrorInfo); /** * Get a snapshot of the error. * * @see {@linkcode CommandErrorSnapshot} * * @public * @instance * * @return {CommandErrorSnapshot} * Error snapshot object */ snapshot(): CommandErrorSnapshot; } export default CommandError;