couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [11/11] chttpd commit: updated refs/heads/master to 238b8c4
Date Wed, 12 Aug 2015 15:54:35 GMT
Return `{error, {illegal_database_name, Name}}`


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/238b8c48
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/238b8c48
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/238b8c48

Branch: refs/heads/master
Commit: 238b8c48285ed118821807ee057d1a59775acb06
Parents: 4ba06e0
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Fri Jul 31 11:35:24 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Aug 11 09:14:29 2015 -0700

----------------------------------------------------------------------
 src/chttpd.erl                   | 9 +++++----
 test/chttpd_error_info_tests.erl | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/238b8c48/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 749f550..52400ca 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -804,10 +804,11 @@ error_info({bad_ctype, Reason}) ->
     {415, <<"bad_content_type">>, Reason};
 error_info(requested_range_not_satisfiable) ->
     {416, <<"requested_range_not_satisfiable">>, <<"Requested range not
satisfiable">>};
-error_info({error, illegal_database_name}) ->
-    {400, <<"illegal_database_name">>, <<"Only lowercase letters (a-z),
"
-        "digits (0-9), and any of the characters _, $, (, ), +, -, and / are "
-        "allowed. Moreover, the database name must begin with a letter.">>};
+error_info({error, {illegal_database_name, Name}}) ->
+    Message = <<"Name: '", Name/binary, "'. Only lowercase characters (a-z), ",
+        "digits (0-9), and any of the characters _, $, (, ), +, -, and / ",
+        "are allowed. Must begin with a letter.">>,
+    {400, <<"illegal_database_name">>, Message};
 error_info({missing_stub, Reason}) ->
     {412, <<"missing_stub">>, Reason};
 error_info(request_entity_too_large) ->

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/238b8c48/test/chttpd_error_info_tests.erl
----------------------------------------------------------------------
diff --git a/test/chttpd_error_info_tests.erl b/test/chttpd_error_info_tests.erl
index 447eb42..cb0a58a 100644
--- a/test/chttpd_error_info_tests.erl
+++ b/test/chttpd_error_info_tests.erl
@@ -110,11 +110,11 @@ error_info_test() ->
              <<"Requested range not satisfiable">>}
         },
         {
-            {error, illegal_database_name},
+            {error, {illegal_database_name, <<"foo">>}},
             {400, <<"illegal_database_name">>,
-             <<"Only lowercase letters (a-z), digits (0-9), and any of"
+             <<"Name: 'foo'. Only lowercase characters (a-z), digits (0-9), and any
of"
                " the characters _, $, (, ), +, -, and / are allowed."
-               " Moreover, the database name must begin with a letter.">>}
+               " Must begin with a letter.">>}
         },
         {
             {missing_stub, Reason},


Mime
View raw message