You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ns...@apache.org on 2012/11/17 20:52:50 UTC
[30/30] git commit: when reporting a bad db name,
put the wrong value in the log message
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/docs
Commit: 66529378dd06342929e04772370f3509cbe786a5
Parents: 53680d6
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Oct 15 16:18:30 2012 +0200
Committer: Jan Lehnardt <ja...@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