eiri commented on a change in pull request #1897: Fix _bulk_docs crash when provided revision can't be parsed URL: https://github.com/apache/couchdb/pull/1897#discussion_r253705098
########## File path: src/couch/src/couch_doc.erl ########## @@ -275,9 +275,16 @@ transfer_fields([{<<"_revisions">>, {Props}} | Rest], Doc, DbName) -> true -> ok end, - [throw({doc_validation, "RevId isn't a string"}) || - RevId <- RevIds, not is_binary(RevId)], - RevIds2 = [parse_revid(RevId) || RevId <- RevIds], + RevIds2 = lists:map(fun(RevId) -> + try Review comment: there are two possibilities for `badarg`, actually, an inconvertible list to `?l2b` is the second, but honestly, I think we (server side) don't care _why_ exactly parse failed as long as we can pass back a message that the rev format is invalid and then let the user to figure it out. this is a simple fix for a simple bug and I don't feel that overcomplicating things with validators and whatnot will add any value here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services