Github user nickva commented on a diff in the pull request:
https://github.com/apache/couchdb-couch/pull/177#discussion_r77225082
--- Diff: src/couch_changes.erl ---
@@ -377,6 +379,21 @@ check_selector(_Selector) ->
throw({bad_request, "Selector error: expected a JSON object"}).
+check_fields(nil) ->
+ nil;
+check_fields(Fields) when is_list(Fields) ->
+ try
+ {ok, Fields1} = mango_fields:new(Fields),
+ Fields1
+ catch
+ {mango_error, Mod, Reason0} ->
+ {_StatusCode, _Error, Reason} = mango_error:info(Mod, Reason0),
+ throw({bad_request, Reason})
--- End diff --
It does, it throws `{mango_error,...` but in this context other validation
functions return `{bad_request,...` so made mango fields parsing do the same
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---