From: Eric Wong Date: Thu, 28 Aug 2014 02:15:08 +0000 (+0000) Subject: feed: deal with removed files X-Git-Tag: v1.0.0~1131 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e3884bc14d2540192ec065a8b082fc9d0f68f343;p=public-inbox.git feed: deal with removed files Sometimes we get spam and need to delete messages, we must prevent errors on missing messages from propagating. --- diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 1eaba6c2..646c85c9 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -291,8 +291,11 @@ sub dump_msg { sub do_cat_mail { my ($git, $path) = @_; - my $str = $git->cat_file("HEAD:$path"); - Email::MIME->new($str); + my $mime = eval { + my $str = $git->cat_file("HEAD:$path"); + Email::MIME->new($str); + }; + $@ ? undef : $mime; } 1;