[PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 21 Oct 2012 13:35:09 +0000 (16:35 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:56 +0000 (09:49 -0800)
ca/117065b07709b70e4bf528281efd4d37721c2d [new file with mode: 0644]

diff --git a/ca/117065b07709b70e4bf528281efd4d37721c2d b/ca/117065b07709b70e4bf528281efd4d37721c2d
new file mode 100644 (file)
index 0000000..2af5f1c
--- /dev/null
@@ -0,0 +1,82 @@
+Return-Path: <too@guru-group.fi>\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 7C8F8431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:35:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 AioeRUbLvQay for <notmuch@notmuchmail.org>;\r
+       Sun, 21 Oct 2012 06:35:08 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id EE7CB431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:35:07 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 05E92100372; Sun, 21 Oct 2012 16:35:10 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error\r
+Date: Sun, 21 Oct 2012 16:35:09 +0300\r
+Message-Id: <1350826509-12119-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\r
+Cc: tomi.ollila@iki.fi\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: Sun, 21 Oct 2012 13:35:08 -0000\r
+\r
+When inserting of email bodypart failes, insert a failure message\r
+to the buffer (and continue) instead of halting the insertion of\r
+the rest of that email thread in question.\r
+---\r
+This is (now real !!!) alternative to\r
+\r
+id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"\r
+\r
+This adds error message string to the output, error message in\r
+id:"87d31artti.fsf@inf-8657.int-evry.fr" is shown as\r
+\r
+  !!! Bodypart insert error: Wrong type argument: stringp, nil !!!\r
+\r
+See id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"\r
+for more discussion.\r
+\r
+ emacs/notmuch-show.el |    7 ++++++-\r
+ 1 files changed, 6 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index f273eb4..d061367 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -815,7 +815,12 @@ message at DEPTH in the current thread."\r
+     ;; Run the content handlers until one of them returns a non-nil\r
+     ;; value.\r
+     (while (and handlers\r
+-              (not (funcall (car handlers) msg part content-type nth depth declared-type)))\r
++              (not (condition-case err\r
++                       (funcall (car handlers) msg part content-type nth depth declared-type)\r
++                     (error (progn\r
++                              (insert "!!! Bodypart insert error: ")\r
++                              (insert (error-message-string err))\r
++                              (insert " !!!\n") nil)))))\r
+       (setq handlers (cdr handlers))))\r
+   t)\r
\r
+-- \r
+1.7.1\r
+\r