Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 5, 2022
1 parent c4d6392 commit 7a4f51c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bin/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ export const handleCliError = function (error) {
}

const getErrorName = function ({ name }) {
return name in ERROR_PROPS ? name : DEFAULT_ERROR_NAME
return name in ERROR_PROPS ? name : 'default'
}

// Error type-specific behavior
const ERROR_PROPS = {
default: { exitCode: 5 },
CoreError: { exitCode: 5 },
PluginError: { exitCode: 4 },
UserCodeError: { exitCode: 3 },
UserError: { exitCode: 2, short: true },
LimitError: { exitCode: 1, short: true },
StopError: { exitCode: 0, short: true },
}

const DEFAULT_ERROR_NAME = 'CoreError'

0 comments on commit 7a4f51c

Please sign in to comment.