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