]> Sergey Matveev's repositories - public-inbox.git/commitdiff
qspawn: log errors for generic PSGI server users
authorEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:31:19 +0000 (08:31 +0000)
committerEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:31:42 +0000 (08:31 +0000)
Generic PSGI servers have $env->{'psgi.errors'}, too,
so ensure they can log errors.

lib/PublicInbox/Qspawn.pm

index 6b350f0f7ed152a5def1104b5b72203c27d6f22e..844d50f7cdeedb6775df8183df8a2d3f9bb83c18 100644 (file)
@@ -116,10 +116,9 @@ sub waitpid_err ($$) {
 sub do_waitpid ($;$) {
        my ($self, $env) = @_;
        my $pid = $self->{pid};
-       eval { # PublicInbox::DS may not be loaded
-               PublicInbox::DS::dwaitpid($pid, \&waitpid_err, $self);
-               $self->{env} = $env;
-       };
+       $self->{env} = $env;
+       # PublicInbox::DS may not be loaded
+       eval { PublicInbox::DS::dwaitpid($pid, \&waitpid_err, $self) };
        # done if we're running in PublicInbox::DS::EventLoop
        if ($@) {
                # non public-inbox-{httpd,nntpd} callers may block: