couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [43/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:01:16 GMT
Merge differences in catch_error from original

 - catch_error(_HttpReq, exit, normal)
 - catch_error(HttpReq, throw, unacceptable_encoding)
 - catch_error(HttpReq, throw, bad_accept_encoding_value)
 - catch_error(HttpReq, exit, snappy_nif_not_loaded)


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/commit/557ceb3c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/557ceb3c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/557ceb3c

Branch: refs/heads/split_out_httpd_stack
Commit: 557ceb3c258ecfe346021e6c0c6675f16e292273
Parents: f6b3f96
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Fri Feb 26 11:25:37 2016 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Mar 1 08:35:09 2016 -0800

----------------------------------------------------------------------
 src/couch_httpd_handler.erl | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/557ceb3c/src/couch_httpd_handler.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_handler.erl b/src/couch_httpd_handler.erl
index 2c12c67..a1f6eb2 100644
--- a/src/couch_httpd_handler.erl
+++ b/src/couch_httpd_handler.erl
@@ -264,14 +264,25 @@ catch_error(HttpReq, exit, {mochiweb_recv_error, E}) ->
         MochiReq:get(raw_path),
         E]),
     exit(normal);
+catch_error(_HttpReq, exit, normal) ->
+    exit(normal);
 catch_error(HttpReq, exit, {uri_too_long, _}) ->
     couch_httpd:send_error(HttpReq, request_uri_too_long);
 catch_error(HttpReq, exit, {body_too_large, _}) ->
     couch_httpd:send_error(HttpReq, request_entity_too_large);
+catch_error(HttpReq, throw, unacceptable_encoding) ->
+    couch_httpd:send_error(HttpReq, {not_acceptable, "unsupported encoding"});
+catch_error(HttpReq, throw, bad_accept_encoding_value) ->
+    couch_httpd:send_error(HttpReq, bad_request);
 catch_error(HttpReq, throw, Error) ->
     couch_httpd:send_error(HttpReq, Error);
 catch_error(HttpReq, error, database_does_not_exist) ->
     couch_httpd:send_error(HttpReq, database_does_not_exist);
+catch_error(HttpReq, exit, snappy_nif_not_loaded) ->
+    ErrorReason = "To access the database or view index, Apache CouchDB"
+        " must be built with Erlang OTP R13B04 or higher.",
+    couch_log:error("~s", [ErrorReason]),
+    couch_httpd:send_error(HttpReq, {bad_otp_release, ErrorReason});
 catch_error(HttpReq, Tag, Error) ->
     Stack = erlang:get_stacktrace(),
     % TODO improve logging and metrics collection for client disconnects


Mime
View raw message