1 Return-Path: <Sebastian@SSpaeth.de>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 67B5B4196F2
\r
6 for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 02:28:18 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id WtFN+E2MW8dg for <notmuch@notmuchmail.org>;
\r
16 Mon, 26 Apr 2010 02:28:17 -0700 (PDT)
\r
17 Received: from homiemail-a13.g.dreamhost.com (caiajhbdcaib.dreamhost.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id 7794C431FC1
\r
20 for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 02:28:17 -0700 (PDT)
\r
21 Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch
\r
22 [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de)
\r
23 by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 87C0F6A806B;
\r
24 Mon, 26 Apr 2010 02:28:10 -0700 (PDT)
\r
25 Received: by sspaeth.de (sSMTP sendmail emulation);
\r
26 Mon, 26 Apr 2010 11:28:08 +0200
\r
27 From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>
\r
28 To: Carl Worth <cworth@cworth.org>,
\r
29 Notmuch development list <notmuch@notmuchmail.org>
\r
30 Subject: Re: Unhandled Xapian exception
\r
31 In-Reply-To: <87bpd8or04.fsf@yoom.home.cworth.org>
\r
32 References: <87aasul8h7.fsf@SSpaeth.de> <87bpd8or04.fsf@yoom.home.cworth.org>
\r
33 User-Agent: Notmuch/0.2-200-g455031c (http://notmuchmail.org) Emacs/23.1.1
\r
34 (x86_64-pc-linux-gnu)
\r
35 Date: Mon, 26 Apr 2010 11:28:07 +0200
\r
36 Message-ID: <87y6ga1s2g.fsf@SSpaeth.de>
\r
38 Content-Type: text/plain; charset=us-ascii
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Mon, 26 Apr 2010 09:28:18 -0000
\r
53 On 2010-04-24, Carl Worth wrote:
\r
54 > On Fri, 23 Apr 2010 13:21:56 +0200, "Sebastian Spaeth" <Sebastian@SSpaeth.de> wrote:
\r
55 > > I propose to try..catch this code block and rather than returning VOID
\r
56 > > it could return NOTMUCH_STATUS_SUCCESS or NOTMUCH_XAPIAN_EXCEPTION.
\r
57 > > Not sure how "notmuch_database_find_message" would notify the caller of
\r
58 > > such an exception situation though. The only possible failure value is
\r
59 > > NULL (which also means did not find such a message).
\r
61 > And to support that, we would need a different scheme in the
\r
62 > library. Basically to just document that all calls might throw an
\r
63 > exception and then not catch and print anything. That would at least be
\r
64 > much simpler in the library. Then the top-level "notmuch" application
\r
65 > could just have a C++ wrapper for main() that would catch and print the
\r
66 > exception message.
\r
68 I think the python API would not be able to catch a C++ exception at the
\r
69 library level. I think the proper fix would be to guard the high level
\r
70 lib/* functions (our public API) and modify the API as needed to notify
\r
73 E.g for msg* = notmuch_database_find_message(id) (which I used to test
\r
74 the existence of a message and where NULL can now also mean that someone
\r
75 modified the database and which renders that test somewhat useless), I
\r
76 would propose that we make it:
\r
78 NOTMUCH_STATUS status = notmuch_database_find_message(id, msg*)
\r
80 where *msg will be filled with the message if it exists and xapian
\r
81 exceptions are notified through the status code.
\r
83 Does this make sense?
\r