From: Eric Wong Date: Thu, 9 Jan 2020 11:14:51 +0000 (+0000) Subject: http: log response_write errors X-Git-Tag: v1.3.0~125 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=dfd30c7aa686968b8a0dbd65c40b90d92816f87c http: log response_write errors Application-supplied callbacks may error out, try to log them so the PSGI app developer can figure out what went wrong. --- diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 1346901a..a6ec1d0d 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -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 {