Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[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.