[RFC PATCH 7/7] vim: mailcap: handle mailcap failure gracefully

Subject: [RFC PATCH 7/7] vim: mailcap: handle mailcap failure gracefully

Date: Thu, 13 Oct 2016 14:13:56 -0600

To: notmuch@notmuchmail.org

Cc: nlhowell@gmail.com

From: Nick Howell


---
 vim/notmuch.vim | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index da747eb..e9baeff 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -370,6 +370,14 @@ ruby << EOF
 						io.each_line do |l|
 							b << l.chomp
 						end
+						if $? != 0
+							b << "--- ERROR: mailcap failed ---"
+							part.decoded.each_line do |l|
+								b << l.chomp
+							end
+						end
+					rescue
+						b << "--- unavailable ---"
 					end
 				rescue
 					b << "--- unavailable ---"
-- 
2.7.3


Thread: