summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarren Smith <garren.smith@gmail.com>2021-01-18 14:03:22 +0200
committerGarren Smith <garren.smith@gmail.com>2021-01-18 14:10:24 +0200
commiteade3bb27932daed9176da7a579b31f856898f39 (patch)
tree821b26818cce96e0f3f613cf3c850940d61195ee
parent71a87fb9e66450fe46d6937e23275a1b28025857 (diff)
downloadcouchdb-timeout-transaction.tar.gz
add http error for fdb 1031timeout-transaction
-rw-r--r--src/chttpd/src/chttpd.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 636aad98b..0c5e27259 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
@@ -999,6 +1001,9 @@ error_info({doc_validation, Reason}) ->
{400, <<"doc_validation">>, Reason};
error_info({invalid_since_seq, Reason}) ->
{400, <<"invalid_since_seq">>, Reason};
+error_info(transaction_timeout) ->
+ {408, <<"transaction_timeout">>,
+ <<"The request transaction timed out" >>};
error_info({missing_stub, Reason}) ->
{412, <<"missing_stub">>, Reason};
error_info(request_entity_too_large) ->