couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-100) DELETE on non-existent DB now returns 500 instead of 404
Date Tue, 05 Aug 2008 23:08:44 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620083#action_12620083
] 

Adam Kocoloski commented on COUCHDB-100:
----------------------------------------

Hi, I did a little sleuthing and found that I could trace the problem down to 

handle_call({open, DbName, Options}, {FromPid,_}, Server)

in couch_server.erl.  Specifically, in line 175 the call to 

couch_db:start_link(DbName, Filepath, Options)

returns {error,not_found}, which is sent back up the chain until it hits a handle_db_request
in couch_httpd.erl that isn't prepared to deal with it:

handle_db_request(Req, Method, {DbName, Rest}) ->
    case couch_db:open(DbName, []) of
        {ok, Db} ->
            try 
                handle_db_request(Req, Method, {DbName, Db, Rest})
            after
                couch_db:close(Db)
            end;
        Error ->
            throw(Error)
    end;

Then everything goes boom.  Hope it helps, Adam

> DELETE on non-existent DB now returns 500 instead of 404
> --------------------------------------------------------
>
>                 Key: COUCHDB-100
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-100
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.9
>         Environment: trunk @ 682809
>            Reporter: Adam Kocoloski
>
> Previously (0.8.0), a DELETE request on a non-existent DB would return a 404 status code
and the message
> {"error":"not_found","reason":"missing"}
> Today's trunk now returns a 500 status code and the message
> {"error":"error","reason":"not_found"}
> This breaks the test suite as it's currently written, since the deleteDb() function expects
a 404 or 200 status code and will raise an exception if anything else is encountered.  To
reproduce, run the test suite without creating the "test_suite_db" beforehand (or delete it
if it exists).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message