summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_view.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-04-18 20:15:44 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-04-18 20:15:44 +0000
commit3e47bfd6586f42f9fe8e49cea03c4df976c781a1 (patch)
treeb3ae7a8203f2d4ec99a84762ea9aedda56864d88 /src/couchdb/couch_httpd_view.erl
parentdaa9d65a53dedaac5aeeb6394d4c0b6f99fa930c (diff)
refactor main.js into many files and improve show/list error handling
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r--src/couchdb/couch_httpd_view.erl26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index 0348cf8b..8702a3dc 100644
--- a/src/couchdb/couch_httpd_view.erl
+++ b/src/couchdb/couch_httpd_view.erl
@@ -530,7 +530,7 @@ apply_default_helper_funs(#view_fold_helper_funs{
Helpers#view_fold_helper_funs{
passed_end = PassedEnd2,
start_response = StartResp2,
- send_row = wrap_for_chunked_errors(SendRow2)
+ send_row = SendRow2
}.
apply_default_helper_funs(#reduce_fold_helper_funs{
@@ -549,7 +549,7 @@ apply_default_helper_funs(#reduce_fold_helper_funs{
Helpers#reduce_fold_helper_funs{
start_response = StartResp2,
- send_row = wrap_for_chunked_errors(SendRow2)
+ send_row = SendRow2
}.
make_passed_end_fun(fwd, EndKey, EndDocId, InclusiveEnd) ->
@@ -606,27 +606,7 @@ send_json_reduce_row(Resp, {Key, Value}, RowFront) ->
nil -> ",\r\n";
_ -> RowFront
end,
- send_chunk(Resp, RowFront2 ++ ?JSON_ENCODE({[{key, Key}, {value, Value}]})).
-
-wrap_for_chunked_errors(Fun) when is_function(Fun, 3)->
- fun(Resp, B, C) ->
- try Fun(Resp, B, C)
- catch
- throw:Error ->
- send_chunked_error(Resp, Error),
- throw({already_sent, Error})
- end
- end;
-
-wrap_for_chunked_errors(Fun) when is_function(Fun, 5)->
- fun(Resp, B, C, D, E) ->
- try Fun(Resp, B, C, D, E)
- catch
- throw:Error ->
- send_chunked_error(Resp, Error),
- throw({already_sent, Error})
- end
- end.
+ send_chunk(Resp, RowFront2 ++ ?JSON_ENCODE({[{key, Key}, {value, Value}]})).
view_group_etag(Group) ->
view_group_etag(Group, nil).