You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2021/01/18 12:03:43 UTC
[couchdb] 02/02: add http error for fdb 1031
This is an automated email from the ASF dual-hosted git repository.
garren pushed a commit to branch timeout-transaction
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f1b474a200031b8237f008fb1f0afe3a1e09f3fb
Author: Garren Smith <ga...@gmail.com>
AuthorDate: Mon Jan 18 14:03:22 2021 +0200
add http error for fdb 1031
---
src/chttpd/src/chttpd.erl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 636aad9..665d2c5 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -364,6 +364,8 @@ catch_error(HttpReq, error, not_ciphertext) ->
send_error(HttpReq, not_ciphertext);
catch_error(HttpReq, error, {erlfdb_error, 2101}) ->
send_error(HttpReq, transaction_too_large);
+catch_error(HttpReq, error, {erlfdb_error, 1031}) ->
+ send_error(HttpReq, transaction_timeout);
catch_error(HttpReq, Tag, Error) ->
Stack = erlang:get_stacktrace(),
% TODO improve logging and metrics collection for client disconnects
@@ -1014,6 +1016,9 @@ error_info({request_entity_too_large, DocID}) ->
error_info(transaction_too_large) ->
{413, <<"transaction_too_large">>,
<<"The request transaction is larger than 10MB" >>};
+error_info(transaction_timeout) ->
+ {413, <<"transaction_timeout">>,
+ <<"The request transaction timed out" >>};
error_info({error, security_migration_updates_disabled}) ->
{503, <<"security_migration">>, <<"Updates to security docs are disabled during "
"security migration.">>};