couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject git commit: when reporting a bad db name, put the wrong value in the log message
Date Mon, 15 Oct 2012 14:18:38 GMT
Updated Branches:
  refs/heads/master 53680d654 -> 66529378d


when reporting a bad db name, put the wrong value in the log message


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

Branch: refs/heads/master
Commit: 66529378dd06342929e04772370f3509cbe786a5
Parents: 53680d6
Author: Jan Lehnardt <jan@apache.org>
Authored: Mon Oct 15 16:18:30 2012 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Mon Oct 15 16:18:30 2012 +0200

----------------------------------------------------------------------
 src/couchdb/couch_httpd.erl  |    9 +++++----
 src/couchdb/couch_server.erl |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/66529378/src/couchdb/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 90d5c80..3774b85 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -802,10 +802,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 characters (a-z),
"
-        "digits (0-9), and any of the characters _, $, (, ), +, -, and / "
-        "are allowed. Must begin with a letter.">>};
+error_info({error, illegal_database_name, Name}) ->
+    Message = "Name: '" ++ Name ++ "'. 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">>, couch_util:to_binary(Message)};
 error_info({missing_stub, Reason}) ->
     {412, <<"missing_stub">>, Reason};
 error_info({Error, Reason}) ->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/66529378/src/couchdb/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 650ce14..0f40c51 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -104,7 +104,7 @@ check_dbname(#server{dbname_regexp=RegExp}, DbName) ->
             "_users" -> ok;
             "_replicator" -> ok;
             _Else ->
-                {error, illegal_database_name}
+                {error, illegal_database_name, DbName}
             end;
     match ->
         ok


Mime
View raw message