forked from apache/couchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle invalid field errors in Mango
Add handling for invalid field errors. Previously they would emit a 500 `badmatch` error with a stack trace: ``` % curl -v -XPOST -H'Content-type:application/json' $URL/db/_find -d '{"selector":{"_id":{"":null}}}' < HTTP/1.1 500 Internal Server Error {"error":"badmatch","reason":"{error,{{mango_error,mango_util,{invalid_field_name... ``` With the fix it emits a 400 error: ``` < HTTP/1.1 400 Bad Request {"error":"invalid_field_name","reason":"Invalid field name: _id."} ``` This should also handle a general class of mango errors from `$db/_find` which are sent from the workers, passed through the fabric/rexi mechanism, and handled on the coordinator side. Previously some of those would emit the same 500 badmatch + a stack trace since we didn't expect errors in a few places which generated a `badmatch`.
- Loading branch information
Showing
5 changed files
with
24 additions
and
3 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
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