--- /dev/null
+Return-Path: <eg@gaute.vetsj.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 10AF6431FBC\r
+ for <notmuch@notmuchmail.org>; Thu, 21 Aug 2014 02:01:20 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id wczr6v2KOVrd for <notmuch@notmuchmail.org>;\r
+ Thu, 21 Aug 2014 02:01:12 -0700 (PDT)\r
+Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com\r
+ [209.85.192.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0E6A7431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 21 Aug 2014 02:01:12 -0700 (PDT)\r
+Received: by mail-qg0-f49.google.com with SMTP id j107so8374294qga.8\r
+ for <notmuch@notmuchmail.org>; Thu, 21 Aug 2014 02:01:10 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:mime-version:in-reply-to:references:date\r
+ :message-id:subject:from:to:content-type;\r
+ bh=SY6FH7tiBKDH4pivZs4H+O65nntus9ylO39RjGKHvhQ=;\r
+ b=T2OHJUxE5C6aK+0+M7lZuEz/n6QOXN6McGsg6jZ/CW+K924ppkeQn3BaxBIpf7NZPH\r
+ eWb++cNUQyfGrNB9P/KOYIQ74Mp3x4/p9oiENIAQ/uO/tWyZsKElR/tzw5feBk9u+hdJ\r
+ 9k4cieF4QdPgHAKOuqQ5NDvWbR95w9aS5O8s/g7VPNSETI85/Z5fQqonvs8W8eDPl3mF\r
+ qDB3FautXuMorRxqe5yfon/VUsM6kGaI2o2E6ytZEIC5+TSgdqlHjs+xKxUhm9TzZzl5\r
+ 3TccgL62NgsOSFts5U0fUpTMeBA0R834uvEIHmCFtSt2Rfu1ZJYjWjDFR0gdh8oQQYKb\r
+ esyg==\r
+X-Gm-Message-State:\r
+ ALoCoQkV5uApY+27YOdlv+ttx04Fgp2EP8yFm6FDk0hFcGlBatrPD0AyNAvcr6AOhx6aD/+95CcI\r
+MIME-Version: 1.0\r
+X-Received: by 10.140.102.142 with SMTP id w14mr80976220qge.101.1408611670062;\r
+ Thu, 21 Aug 2014 02:01:10 -0700 (PDT)\r
+Received: by 10.96.88.40 with HTTP; Thu, 21 Aug 2014 02:01:09 -0700 (PDT)\r
+In-Reply-To: <1408610770-astroid-0-4on2jlyj8n-28086@strange>\r
+References:\r
+ <CABKe4MvEdcsq8BZ-vq6R0Vnw87zEgBvqW_2F-Wysf5GNchqweg@mail.gmail.com>\r
+ <1408610770-astroid-0-4on2jlyj8n-28086@strange>\r
+Date: Thu, 21 Aug 2014 11:01:09 +0200\r
+Message-ID:\r
+ <CABKe4MsspOoNOE+2_us+FcjxbRtMMsnY1k19hfSrff4oqHdFmw@mail.gmail.com>\r
+Subject: Re: DatabaseModifiedErrors causing troubles\r
+From: Gaute Hope <eg@gaute.vetsj.com>\r
+To: notmuch <notmuch@notmuchmail.org>\r
+Content-Type: multipart/mixed; boundary=001a11c163e038ca1a05011ff64a\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 21 Aug 2014 09:01:20 -0000\r
+\r
+--001a11c163e038ca1a05011ff64a\r
+Content-Type: text/plain; charset=UTF-8\r
+\r
+On Thu, Aug 21, 2014 at 10:59 AM, Gaute Hope <eg@gaute.vetsj.com> wrote:\r
+> For portability I would suggest starting to move towards the GError\r
+> scheme provided by glib (also used by gmime). This is a somewhat major\r
+> effort though since ensuring that error propagation is done right [0] is\r
+> somewhat tricky. It provides more or less the same functionality as\r
+> exceptions do in C++.\r
+>\r
+> There is also the problem of having to change the API - one way to avoid\r
+> that is to create wrappers that behave like the old API, but don't\r
+> handle errors that good. This requires the addition of addiontal _error\r
+> variations of the current set of functions. It will be a mess.\r
+>\r
+> [0] https://developer.gnome.org/glib/stable/glib-Error-Reporting.html\r
+\r
+Here's a quick mockup of how that could look.\r
+\r
+Cheers, Gaute\r
+\r
+--001a11c163e038ca1a05011ff64a\r
+Content-Type: text/x-patch; charset=US-ASCII; \r
+ name="0001-mockup-Illustration-of-GError-for-error-reporting.patch"\r
+Content-Disposition: attachment; \r
+ filename="0001-mockup-Illustration-of-GError-for-error-reporting.patch"\r
+Content-Transfer-Encoding: base64\r
+X-Attachment-Id: f_hz3v0kjf0\r
+\r
+RnJvbSBlYjQ5ZTMxMWUzMTJhNWM5NTEwY2EyNGRlYzI0YWQxYzYwYWVkZWU5IE1vbiBTZXAgMTcg\r
+MDA6MDA6MDAgMjAwMQpGcm9tOiBHYXV0ZSBIb3BlIDxlZ0BnYXV0ZS52ZXRzai5jb20+CkRhdGU6\r
+IFRodSwgMjEgQXVnIDIwMTQgMTA6NTY6NTcgKzAyMDAKU3ViamVjdDogW1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