[request] Clearer error message for JSON deserialization failure #2195
Currently, when response JSON is not parsed successfully and an error is raised, the error message only contains the response body.
Motivation and Context
This is unnecessarily cryptic. As someone using the new request implementation for the first time, I was confused as to why just an error "foo" was raised when I was testing a new endpoint.
How Has This Been Tested?
Relevant test updated.
Types of changes
Couple of comments:
You can add your own
If we do want to make this change, Mithril's codebase is ES5 so the template string should be changed to use ES5 string concatination.
Sure, but I don't see a reason not to throw useful errors out-of-the-box.
I will update the PR. I am surprised that the Travis pipeline does not fail because of this if it indeed is an enforced guideline.
…2194) * output mithril, stream and ospec esm versions on build * Add esm bundles * [request] Clearer error message for JSON deserialization failure (#2195) * Bundled output for commit fd7cf80 [skip ci] * Fix #1714 conditionally halting stream (#2200) * Fix #1714 conditionally halting stream * Add note in changelog * Do not include stream as named export in mithril.esm.js * Rename mithril.min.esm.js to mithril.esm.min.js * Add esm files to eslintignore * Add named exports * Add hyperscript `m` as named export * Add builds with export changes * checkout regular bundled files * Change .esm.js to .mjs * Update pkg module to point to .mjs * Fix for export names to avoid collision * Updated bundled files