You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2020/10/13 02:56:16 UTC
[couchdb] branch transaction_too_large created (now d0404f0)
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
at d0404f0 convert erlfdb_error 2101 to transaction_too_large
This branch includes the following new commits:
new d0404f0 convert erlfdb_error 2101 to transaction_too_large
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: convert erlfdb_error 2101 to transaction_too_large
Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a commit to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit d0404f05b05ca26ca1c59f8413ed64f3f7ca2fa2
Author: jiangph <ji...@cn.ibm.com>
AuthorDate: Tue Oct 13 10:55:21 2020 +0800
convert erlfdb_error 2101 to transaction_too_large
---
src/chttpd/src/chttpd.erl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 1a9b19b..04f65c9 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -362,6 +362,8 @@ catch_error(HttpReq, error, decryption_failed) ->
send_error(HttpReq, decryption_failed);
catch_error(HttpReq, error, not_ciphertext) ->
send_error(HttpReq, not_ciphertext);
+catch_error(HttpReq, error, {erlfdb_error,2101}) ->
+ send_error(HttpReq, {request_transcation_too_large, 2101});
catch_error(HttpReq, Tag, Error) ->
Stack = erlang:get_stacktrace(),
% TODO improve logging and metrics collection for client disconnects
@@ -1009,6 +1011,10 @@ error_info({request_entity_too_large, {bulk_get, Max}}) when is_integer(Max) ->
{413, <<"max_bulk_get_count_exceeded">>, integer_to_binary(Max)};
error_info({request_entity_too_large, DocID}) ->
{413, <<"document_too_large">>, DocID};
+error_info({request_transcation_too_large, Code}) ->
+ CodeBin = integer_to_binary(Code),
+ {413, <<"request_transcation_too_large">>,
+ <<"The request transcation is too large. (", CodeBin/binary, ")" >>};
error_info({error, security_migration_updates_disabled}) ->
{503, <<"security_migration">>, <<"Updates to security docs are disabled during "
"security migration.">>};