Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use consistent message for JSON.parse() errors #243

Merged
merged 1 commit into from
May 18, 2023

Conversation

padamstx
Copy link
Member

@padamstx padamstx commented May 17, 2023

This commit modifies the RequestWrapper.ensureJSONResponseBodyIsObject() function so that the thrown exception will have an error message that is consistent with the other cores.
As part of this change, the thrown exception will also contain information about the specific "causedBy" exception that was caught from JSON.parse().

Checklist
  • npm test passes (tip: npm run lint-fix can correct most style issues)
  • tests are included
  • documentation is changed or added

This commit modifies the RequestWrapper.ensureJSONResponseBodyIsObject()
function so that the thrown exception will have an error message that
is consistent with the other cores.
As part of this change, the thrown exception will also
contain information about the specific "causedBy" exception that was
caught from JSON.parse().

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
@padamstx padamstx requested a review from dpopp07 May 17, 2023 19:53
@padamstx padamstx self-assigned this May 17, 2023
Copy link
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@padamstx padamstx merged commit 3cc7bab into main May 18, 2023
@padamstx padamstx deleted the json-error-message branch May 18, 2023 15:11
ibm-devx-sdk pushed a commit that referenced this pull request May 18, 2023
## [4.0.6](v4.0.5...v4.0.6) (2023-05-18)

### Bug Fixes

* use consistent message for JSON.parse() errors ([#243](#243)) ([3cc7bab](3cc7bab))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 4.0.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants