Created
January 30, 2014 21:53
-
-
Save rnewson/8720700 to your computer and use it in GitHub Desktop.
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
commit 3659c01c686f61ae222735dd9e08b932163438e1 | |
Author: Robert Newson <rnewson@apache.org> | |
Date: 2014-01-30 21:46:36 +0000 | |
Produce a readable error if status code for open_revs is not 200 | |
CouchDB-2043 | |
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl | |
index 52e15b7..344074e 100644 | |
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl | |
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl | |
@@ -171,13 +171,15 @@ open_doc_revs(#httpdb{} = HttpDb, Id, Revs, Options, Fun, Acc) -> | |
QS = options_to_query_args(HttpDb, Path, [revs, {open_revs, Revs} | Options]), | |
{Pid, Ref} = spawn_monitor(fun() -> | |
Self = self(), | |
- Callback = fun(200, Headers, StreamDataFun) -> | |
- remote_open_doc_revs_streamer_start(Self), | |
- {<<"--">>, _, _} = couch_httpd:parse_multipart_request( | |
- get_value("Content-Type", Headers), | |
- StreamDataFun, | |
- fun mp_parse_mixed/1 | |
- ) | |
+ Callback = fun | |
+ (200, Headers, StreamDataFun) -> | |
+ remote_open_doc_revs_streamer_start(Self), | |
+ {<<"--">>, _, _} = couch_httpd:parse_multipart_request( | |
+ get_value("Content-Type", Headers), | |
+ StreamDataFun, | |
+ fun mp_parse_mixed/1); | |
+ (Code, _, _) -> | |
+ exit({unexpected_status_code, Code}) | |
end, | |
Streamer = spawn_link(fun() -> | |
Params = [ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment