From daf255771e50f720bad558a2218decd0d1a26bb1 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Tue, 15 Jun 2010 11:58:01 -0400 Subject: return 409 on update conflict --- src/chttpd.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}) -> -- cgit v1.2.3