From dfd30c7aa686968b8a0dbd65c40b90d92816f87c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Jan 2020 11:14:51 +0000 Subject: 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. --- lib/PublicInbox/HTTP.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox') 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 { -- cgit v1.2.3-24-ge0c7