From e3884bc14d2540192ec065a8b082fc9d0f68f343 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 Aug 2014 02:15:08 +0000 Subject: feed: deal with removed files Sometimes we get spam and need to delete messages, we must prevent errors on missing messages from propagating. --- lib/PublicInbox/Feed.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3-24-ge0c7