diff --git a/package.json b/package.json index 0855e1c0..6fedaf21 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/oclif/command/issues", "dependencies": { "@oclif/config": "^1.15.1", - "@oclif/errors": "^1.2.2", + "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.3", "@oclif/plugin-help": "^3", "debug": "^4.1.1", diff --git a/src/command.ts b/src/command.ts index 7b7721ea..58a4555b 100644 --- a/src/command.ts +++ b/src/command.ts @@ -8,6 +8,7 @@ import {format, inspect} from 'util' import * as flags from './flags' import {sortBy, uniqBy} from './util' import {getHelpClass} from '@oclif/plugin-help' +import {PrettyPrintableError} from '@oclif/errors' /** * swallows stdout epipe errors @@ -122,11 +123,11 @@ export default abstract class Command { Errors.warn(input) } - error(input: string | Error, options: {code?: string; exit: false}): void + error(input: string | Error, options: {code?: string; exit: false} & PrettyPrintableError): void - error(input: string | Error, options?: {code?: string; exit?: number}): never + error(input: string | Error, options?: {code?: string; exit?: number} & PrettyPrintableError): never - error(input: string | Error, options: {code?: string; exit?: number | false} = {}) { + error(input: string | Error, options: {code?: string; exit?: number | false} & PrettyPrintableError = {}) { return Errors.error(input, options as any) } diff --git a/yarn.lock b/yarn.lock index f52cc58c..784590e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,6 +73,17 @@ strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +"@oclif/errors@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.3.3.tgz#fb597dfbc58c6b8609dc0b2fdf91a2d487818a82" + integrity sha512-EJR6AIOEkt/NnARNIVAskPDVtdhtO5TTNXmhDrGqMoWVsr0R6DkkLrMyq95BmHvlVWM1nduoq4fQPuCyuF2jaA== + dependencies: + clean-stack "^3.0.0" + fs-extra "^9.0.1" + indent-string "^4.0.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + "@oclif/linewrap@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91"