* [PATCH 0/2] trivial warning message improvements
@ 2017-05-09 6:30 Eric Wong
2017-05-09 6:30 ` [PATCH 1/2] searchidx: use cached local $@ copy Eric Wong
2017-05-09 6:30 ` [PATCH 2/2] watchmaildir: show $@ in warning message Eric Wong
0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2017-05-09 6:30 UTC (permalink / raw)
To: meta
Eric Wong (2):
searchidx: use cached local $@ copy
watchmaildir: show $@ in warning message
lib/PublicInbox/SearchIdx.pm | 2 +-
lib/PublicInbox/WatchMaildir.pm | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] searchidx: use cached local $@ copy
2017-05-09 6:30 [PATCH 0/2] trivial warning message improvements Eric Wong
@ 2017-05-09 6:30 ` Eric Wong
2017-05-09 6:30 ` [PATCH 2/2] watchmaildir: show $@ in warning message Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2017-05-09 6:30 UTC (permalink / raw)
To: meta
umask should never fail and set $@, but use the cached local
to be more explicit just in case.
---
lib/PublicInbox/SearchIdx.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index e4e3c81..fd0d320 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -620,7 +620,7 @@ sub with_umask {
my $rv = eval { $cb->() };
my $err = $@;
umask $old;
- die $err if $@;
+ die $err if $err;
$rv;
}
--
EW
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] watchmaildir: show $@ in warning message
2017-05-09 6:30 [PATCH 0/2] trivial warning message improvements Eric Wong
2017-05-09 6:30 ` [PATCH 1/2] searchidx: use cached local $@ copy Eric Wong
@ 2017-05-09 6:30 ` Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2017-05-09 6:30 UTC (permalink / raw)
To: meta
It should be helpful to know what error happened.
---
lib/PublicInbox/WatchMaildir.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index 985f919..c436742 100644
--- a/lib/PublicInbox/WatchMaildir.pm
+++ b/lib/PublicInbox/WatchMaildir.pm
@@ -111,7 +111,10 @@ sub _remove_spam {
$im->remove($scrubbed);
}
};
- warn "error removing spam at $path from $ibx->{name}\n" if $@;
+ if ($@) {
+ warn "error removing spam at: ", $path,
+ " from ", $ibx->{name}, ': ', $@, "\n";
+ }
})
}
--
EW
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-09 6:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09 6:30 [PATCH 0/2] trivial warning message improvements Eric Wong
2017-05-09 6:30 ` [PATCH 1/2] searchidx: use cached local $@ copy Eric Wong
2017-05-09 6:30 ` [PATCH 2/2] watchmaildir: show $@ in warning message Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).