Skip to content

Commit

Permalink
Log more robustly when JSON parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed Nov 30, 2022
1 parent ca7a668 commit d8b0aa3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/json/src/index.js
Expand Up @@ -24,8 +24,7 @@ export default function json(options = {}) {
};
} catch (err) {
const message = 'Could not parse JSON file';
const position = parseInt(/[\d]/.exec(err.message)[0], 10);
this.warn({ message, id, position });
this.warn({ message, id, cause: err });
return null;
}
}
Expand Down

0 comments on commit d8b0aa3

Please sign in to comment.