]> Sergey Matveev's repositories - public-inbox.git/commitdiff
http: log response_write errors
authorEric Wong <e@yhbt.net>
Thu, 9 Jan 2020 11:14:51 +0000 (11:14 +0000)
committerEric Wong <e@80x24.org>
Thu, 9 Jan 2020 11:23:32 +0000 (11:23 +0000)
Application-supplied callbacks may error out, try to log them
so the PSGI app developer can figure out what went wrong.

lib/PublicInbox/HTTP.pm

index 1346901ad52300fd4b9985c18ba912502ce0f649..a6ec1d0d7388540e2ace1a90ae16751f641297aa 100644 (file)
@@ -174,7 +174,10 @@ sub app_dispatch {
                        response_write($self, $env, $res);
                }
        };
-       $self->close if $@;
+       if ($@) {
+               err($self, "response_write error: $@");
+               $self->close;
+       }
 }
 
 sub response_header_write {