]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: warn on event loop errors
authorEric Wong <e@80x24.org>
Tue, 14 Sep 2021 02:39:01 +0000 (02:39 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Sep 2021 02:56:52 +0000 (02:56 +0000)
This should help us notice (and fix) bugs more easily.

lib/PublicInbox/LEI.pm

index 784e679d564a9eb8d8bab0d8ec2641248fd9747b..f0caac03b1b622c2cfd24474f71c33aef963ec71 100644 (file)
@@ -1347,7 +1347,8 @@ sub lazy_start {
        open STDERR, '>&STDIN' or die "redirect stderr failed: $!";
        open STDOUT, '>&STDIN' or die "redirect stdout failed: $!";
        # $daemon pipe to `lei' closed, main loop begins:
-       PublicInbox::DS->EventLoop;
+       eval { PublicInbox::DS->EventLoop };
+       warn "event loop error: $@\n" if $@;
        dump_and_clear_log();
        exit($exit_code // 0);
 }