From ce18b29d175ef5f01f05d59c95bcf8e0cd40e611 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 19 Apr 2019 07:41:22 +0000 Subject: index: warn with info about the message as context This can help users track down the source of warnings when presented with imperfect emails. While we're at it, make the __WARN__ callback in t/v2writable.t a no-op since we don't check for warnings, there. --- script/public-inbox-index | 3 +++ 1 file changed, 3 insertions(+) (limited to 'script') diff --git a/script/public-inbox-index b/script/public-inbox-index index 5adb6e74..2f810a56 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -85,6 +85,9 @@ sub index_dir { } } } + local $SIG{__WARN__} = sub { + print STDERR $v2w->{current_info}, ': ', @_; + }; $v2w->index_sync({ reindex => $reindex, prune => $prune }); } else { my $s = PublicInbox::SearchIdx->new($repo, 1); -- cgit v1.2.3-24-ge0c7