Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 90F46429E21 for ; Sun, 29 Jan 2012 10:01:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Date" X-Spam-Flag: NO X-Spam-Score: 0.432 X-Spam-Level: X-Spam-Status: No, score=0.432 tagged_above=-999 required=5 tests=[INVALID_DATE=0.432] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cm2sSpl98xc9 for ; Sun, 29 Jan 2012 10:01:28 -0800 (PST) Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id F1E34431E64 for ; Sun, 29 Jan 2012 10:01:27 -0800 (PST) Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cryptobitch.de (Postfix) with ESMTPSA id CED8150FAE9 for ; Sun, 29 Jan 2012 19:01:26 +0100 (CET) Received: by mail.jade-hamburg.de (Postfix, from userid 401) id 32F25DF2A2; Sun, 29 Jan 2012 19:01:26 +0100 (CET) Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.109]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: teythoon) by mail.jade-hamburg.de (Postfix) with ESMTPSA id A1D60DF2A0 for ; Sun, 29 Jan 2012 19:01:25 +0100 (CET) Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) (envelope-from ) id 1RrZ48-0008Iz-WA for notmuch@notmuchmail.org; Sun, 29 Jan 2012 19:01:25 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Justus Winter <4winter@informatik.uni-hamburg.de> User-Agent: alot/0.2-372-g8f06 To: notmuch mailing list , Date: Sun, 29 Jan 2012 18:01:24 -0000 Message-ID: <20120129180124.23430.33656@thinkbox.jade-hamburg.de> Subject: error handling and stderr Date: Sun, 29 Jan 2012 19:01:24 +0100 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 18:01:28 -0000 Hi notmuch developers, currently there is no way to determine why opening a database using notmuch_database_open fails. I suppose that this is a problem for all functions returning a pointer, but it is especially problematic for this function since one cannot distinguish between a temporary failure (someone else opened the db read/write) and a configuration problem (wrong path). This is a real problem for providing sensible feedback to the user. And writing an error message to stderr is a sensible thing to do if it is done in a command line utility but doing so within a library is a severe problem for any curses frontends and is generally considered a bad practice. For the record, libabcs README[0] agrees with me on both aspects. Since fixing this means breaking the api we need to discuss this thoroughly and identify all the functions involved. Users of the python bindings won't be affected by an api change like this since we're converting any error code to exceptions anyway. Cheers, Justus 0: https://git.kernel.org/?p=3Dlinux/kernel/git/kay/libabc.git;a=3Dblob_pla= in;f=3DREADME