Skip to content

Conversation

erezrokah
Copy link
Contributor

src/config.js Outdated
try {
thresholds = JSON.parse(thresholds);
} catch (e) {
throw new Error(`Invalid JSON for 'thresholds' input`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should e.message be included in the thrown error message? This would allow the user to know which character failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5830905

@erezrokah erezrokah merged commit 7417e91 into master Sep 10, 2020
@erezrokah erezrokah deleted the fix/report_invalid_json branch September 10, 2020 14:00
erezrokah added a commit that referenced this pull request Sep 10, 2020
## [1.4.2](v1.4.1...v1.4.2) (2020-09-10)

### Bug Fixes

* report relevant error on invalid jsons ([#80](#80)) ([7417e91](7417e91))
@erezrokah
Copy link
Contributor Author

🎉 This PR is included in version 1.4.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error handling of invalid JSON in audits
2 participants