[RFC/PATCH v4 06/49] Git/Packet.pm: improve error message
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jun 20, 2017, 07:54 UTC
- Message-ID
- <20170620075523.26961-7-chriscool@tuxfamily.org>
- In-Reply-To
- <20170620075523.26961-1-chriscool@tuxfamily.org>
Try to give a bit more information when we die() because there is no new line at the end of something we receive.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> --- perl/Git/Packet.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/perl/Git/Packet.pm b/perl/Git/Packet.pm index aaffecbe2a..2ad6b00d6c 100644 --- a/perl/Git/Packet.pm +++ b/perl/Git/Packet.pm @@ -49,7 +49,8 @@ sub packet_bin_read { sub packet_txt_read { my ( $res, $buf ) = packet_bin_read(); unless ( $res == -1 || $buf =~ s/\n$// ) { - die "A non-binary line MUST be terminated by an LF."; + die "A non-binary line MUST be terminated by an LF.\n" + . "Received: '$buf'"; } return ( $res, $buf ); }
-- 2.13.1.565.gbfcd7a9048