summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-03-24 10:48:09 +0000
committerJan Lehnardt <jan@apache.org>2009-03-24 10:48:09 +0000
commitd9b157680364cb182546e6578d75c7a382f3ec8f (patch)
tree7e3bbdc54b45ade38e0f5c83900c913315b2fd3c
parentaaf043f9f290c6553e0f9734bf8916a0b4ce7e80 (diff)
make some error messages more readable, committed for jchris
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@757714 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_httpd.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 4dfbd954..4acc3d44 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -394,6 +394,8 @@ end_json_response(Resp) ->
send_chunk(Resp, []).
+error_info({Error, Reason}) when is_list(Reason) ->
+ error_info({Error, ?l2b(Reason)});
error_info(bad_request) ->
{400, <<"bad_request">>, <<>>};
error_info({bad_request, Reason}) ->
@@ -440,7 +442,7 @@ send_error(Req, Code, Headers, ErrorStr, ReasonStr) ->
{[{<<"error">>, ErrorStr},
{<<"reason">>, ReasonStr}]}).
- send_redirect(Req, Path) ->
+send_redirect(Req, Path) ->
Headers = [{"Location", couch_httpd:absolute_uri(Req, Path)}],
send_response(Req, 301, Headers, <<>>).