summaryrefslogtreecommitdiff
path: root/src/chttpd.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-06-15 11:58:01 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:45 -0400
commitdaf255771e50f720bad558a2218decd0d1a26bb1 (patch)
tree1d86740d5dd79e4fba89b18ce2abbab0263f5798 /src/chttpd.erl
parent6b0e1f6da54c61714b6aef1a7a7991ab8c13b631 (diff)
return 409 on update conflict
Diffstat (limited to 'src/chttpd.erl')
-rw-r--r--src/chttpd.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 8a5af130..51edbef2 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -484,7 +484,7 @@ validate_callback([Char | Rest]) ->
error_info({Error, Reason}) when is_list(Reason) ->
- error_info({Error, ?l2b(Reason)});
+ error_info({Error, couch_util:to_binary(Reason)});
error_info(bad_request) ->
{400, <<"bad_request">>, <<>>};
error_info({bad_request, Reason}) ->
@@ -499,6 +499,8 @@ error_info({not_acceptable, Reason}) ->
{406, <<"not_acceptable">>, Reason};
error_info(conflict) ->
{409, <<"conflict">>, <<"Document update conflict.">>};
+error_info({conflict, _}) ->
+ {409, <<"conflict">>, <<"Document update conflict.">>};
error_info({forbidden, Msg}) ->
{403, <<"forbidden">>, Msg};
error_info({credentials_expired, Msg}) ->