This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message for JSON parsing errors
This works by overriding the Flask Request's json `on_loading_json_failed(e)` function so that it returns a descriptive HTTP 400 rather than an empty one. Note that we're trying to test against a specific exception string defined by the JSON class - this is not stable (see python/cpython@d4b0761) - so I've made the message matcher use regular expressions rather than exact string match. This required upgrading the hamcrest module to a later version for `matches_regexp` https://www.pivotaltracker.com/story/show/69911234 [Delivers #69911234]
- Loading branch information
Paul M Furley
committed
May 8, 2014
1 parent
f42eeef
commit 5ca52d0
Showing
4 changed files
with
16 additions
and
6 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
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