Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 1168 invoked from network); 1 Feb 2011 23:47:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 23:47:21 -0000 Received: (qmail 46385 invoked by uid 500); 1 Feb 2011 23:47:20 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 46218 invoked by uid 500); 1 Feb 2011 23:47:20 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 46210 invoked by uid 99); 1 Feb 2011 23:47:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 23:47:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 23:47:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 34B85188F8F for ; Tue, 1 Feb 2011 23:46:29 +0000 (UTC) Date: Tue, 1 Feb 2011 23:46:29 +0000 (UTC) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Message-ID: <1242475011.4077.1296603989212.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <17943979.241231294593826110.JavaMail.jira@thor> Subject: [jira] Commented: (COUCHDB-1018) trying to attach a file to a document and specifying a nonexistent revision number causes status code 500 in the HTTP response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989458#comment-12989458 ] Paul Joseph Davis commented on COUCHDB-1018: -------------------------------------------- Minor nit on the layout of that case statement. I'd prefer something more like: case couch_db:open_doc_revs(Db, DocId, [Rev], []) of {ok, [{ok, Doc0}]} -> Doc0; {ok, [{{not_found, missing}, Rev}]} -> throw(conflict); {ok, [Error]} -> throw(Error) end > trying to attach a file to a document and specifying a nonexistent revision number causes status code 500 in the HTTP response > ------------------------------------------------------------------------------------------------------------------------------ > > Key: COUCHDB-1018 > URL: https://issues.apache.org/jira/browse/COUCHDB-1018 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Reporter: Klaus Trainer > Priority: Minor > Attachments: 0001-Fix-COUCHDB-1018.patch > > > When trying to attach a file to a document and specifying a nonexistent revision number, the HTTP response's status code is 500. This status code is plainly wrong, as there is definitely no Internal Server Error in that case. > When trying to update a document body and specifying a nonexistent revision number, the HTTP response's status code is 409 (which is reasonable). > Here, the resulting HTTP status codes should be consistent, i.e., independent of the fact whether a new version of the document body or an attachment is written. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira