From b61d25f5d15922cd36fd3768cada11ab42d87897 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 14 Jun 2010 11:46:14 -0400 Subject: more obvious file_exists create error handling --- src/chttpd.erl | 2 +- src/chttpd_db.erl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3