Skip to content

Commit

Permalink
fix: error variable was shadowed by function (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed May 24, 2023
1 parent 2e7eab8 commit 17fe528
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/lockfile-lint/bin/lockfile-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ let config
try {
config = require('../src/config')(process.argv)
debug(`parsed the following options: ${JSON.stringify(config)}`)
} catch (err) {
debug(`error loading options from CLI arguments/files: ${err}`)
} catch (errorPayload) {
debug(`error loading options from CLI arguments/files: ${errorPayload}`)
process.exit(1)

Check warning on line 36 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v14.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead

Check warning on line 36 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v16.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead

Check warning on line 36 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v18.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead
}

Expand Down Expand Up @@ -82,10 +82,10 @@ try {
type: config['type'],
validators
})
} catch (error) {
} catch (errorPayload) {
warn('ABORTING lockfile lint process due to error exceptions')
console.error(error.message, '\n')
console.error(error.stack, '\n')
console.error(errorPayload.message, '\n')
console.error(errorPayload.stack, '\n')
error('Error: command failed with exit code 1')
process.exit(1)

Check warning on line 90 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v14.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead

Check warning on line 90 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v16.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead

Check warning on line 90 in packages/lockfile-lint/bin/lockfile-lint.js

View workflow job for this annotation

GitHub Actions / Node v18.x ((ubuntu-latest))

Don't use process.exit(); throw an error instead
}
Expand Down

0 comments on commit 17fe528

Please sign in to comment.