]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watchmaildir: show $@ in warning message
authorEric Wong <e@80x24.org>
Tue, 9 May 2017 06:30:42 +0000 (06:30 +0000)
committerEric Wong <e@80x24.org>
Tue, 9 May 2017 20:25:21 +0000 (20:25 +0000)
It should be helpful to know what error happened.

lib/PublicInbox/WatchMaildir.pm

index 985f9192078f3497de62e6da5691f706579ef90a..c436742cfa6244a191ea62503ac6771cb2a57edb 100644 (file)
@@ -111,7 +111,10 @@ sub _remove_spam {
                                $im->remove($scrubbed);
                        }
                };
                                $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";
+               }
        })
 }
 
        })
 }