Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

fix: EEXIT error raised by sfdx-cli results in err instanceof ExitError equals false #157

Merged
merged 1 commit into from
May 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* eslint-disable unicorn/no-process-exit */
import {config} from './config'
import prettyPrint, {PrettyPrintableError} from './errors/pretty-print'
import {ExitError} from '.'
import clean = require('clean-stack')
import {OclifError, CLIError} from './errors/cli'

Expand All @@ -11,7 +10,7 @@ export const handle = (err: Error & Partial<PrettyPrintableError> & Partial<Ocli
if (!err) err = new CLIError('no error?')
if (err.message === 'SIGINT') process.exit(1)

const shouldPrint = !(err instanceof ExitError)
const shouldPrint = !(err.code === 'EEXIT')
const pretty = prettyPrint(err)
const stack = clean(err.stack || '', {pretty: true})

Expand Down