-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better error-handling for non-JSON responses (#538)
* chore(deps): bring mime-types into the mix We already have this package installed as part of `form-data`, but now we're going to use it to parse content-type headers. * feat: add non-JSON handling to `handleRes` This is mostly functionally equivalent, but now we check the Content-Type of the response before parsing its body as JSON. That way we can inspect the body properly. * refactor(openapi): use handleRes for error handling * test: update tests to reflect new error conditions * Update __tests__/cmds/openapi.test.js Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com> Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
- Loading branch information
1 parent
dbd6930
commit 60b7f8f
Showing
5 changed files
with
64 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters