hookdeck / hookdeck-cli

Alternative to ngrok for localhost asynchronous web development (e.g. webhooks). No account required.
https://hookdeck.com?ref=github-hookdeck-cli
Apache License 2.0
261 stars 9 forks source link

fix: Better error message when not a JSON response #35

Closed leetrout closed 2 years ago

leetrout commented 2 years ago

This PR changes error messages when JSON cannot be parsed:

unexpected http status code: 401 invalid character 'U' looking for beginning of value

becomes

unexpected http status code: 401 Unauthorized

Also removes redundant cast to string for string formatting directive and returns error value in postprocessJsonResponse to make linter happy.