]> git.notmuchmail.org Git - notmuch/commitdiff
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)
committerDavid Bremner <bremner@debian.org>
Wed, 7 Nov 2012 12:04:12 +0000 (08:04 -0400)
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.

emacs/notmuch-show.el

index f273eb406cb0daf38aec0a3f13286df7a49a556f..d061367e82a3da89db04bdd27ede1ab6ea67604b 100644 (file)
@@ -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)