From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8C1B91FD4D for ; Thu, 9 Jan 2020 11:14:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] http: log response_write errors Date: Thu, 9 Jan 2020 11:14:51 +0000 Message-Id: <20200109111452.14556-3-e@yhbt.net> In-Reply-To: <20200109111452.14556-1-e@yhbt.net> References: <20200109111452.14556-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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 {