summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-06-14 11:46:14 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:45 -0400
commitb61d25f5d15922cd36fd3768cada11ab42d87897 (patch)
treed3df3d38b8c802f84f5ab5e7e7ad5e80408a0d79
parent35bc59279c9d6de45e27ce87573eeeacfda9289e (diff)
more obvious file_exists create error handling
-rw-r--r--src/chttpd.erl2
-rw-r--r--src/chttpd_db.erl2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/chttpd.erl b/src/chttpd.erl
index f3c4a9da..8a5af130 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -22,7 +22,7 @@
server_header/0, start_chunked_response/3,send_chunk/2,
start_response_length/4, send/2, start_json_response/2,
start_json_response/3, end_json_response/1, send_response/4,
- send_method_not_allowed/2, send_error/4, send_redirect/2,
+ send_method_not_allowed/2, send_error/2, send_error/4, send_redirect/2,
send_chunked_error/2, send_json/2,send_json/3,send_json/4]).
start_link() ->
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 10388ff5..dc1f6df3 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -149,6 +149,8 @@ create_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
ok ->
DocUrl = absolute_uri(Req, "/" ++ couch_util:url_encode(DbName)),
send_json(Req, 201, [{"Location", DocUrl}], {[{ok, true}]});
+ {error, file_exists} ->
+ chttpd:send_error(Req, file_exists);
Error ->
throw(Error)
end.