Skip to content

Commit

Permalink
style: rollback to ecma 2017 catches
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Nov 3, 2019
1 parent 0667e92 commit 6939e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
node_js:
- "8"
- "10"
- "12"
script:
- yarn test
- stage: release
Expand Down
6 changes: 3 additions & 3 deletions lib/getManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getManifest(path) {
let stat;
try {
stat = lstatSync(path);
} catch {
} catch (_) {
// istanbul ignore next (hard to test — happens if no read acccess etc).
throw new ReferenceError(`package.json cannot be read: "${path}"`);
}
Expand All @@ -29,7 +29,7 @@ function getManifest(path) {
let contents;
try {
contents = readFileSync(path, "utf8");
} catch {
} catch (_) {
// istanbul ignore next (hard to test — happens if no read access etc).
throw new ReferenceError(`package.json cannot be read: "${path}"`);
}
Expand All @@ -38,7 +38,7 @@ function getManifest(path) {
let manifest;
try {
manifest = JSON.parse(contents);
} catch {
} catch (_) {
throw new SyntaxError(`package.json could not be parsed: "${path}"`);
}

Expand Down

0 comments on commit 6939e27

Please sign in to comment.