Skip to content

Commit 00df039

Browse files
chriscoolgitster
authored andcommitted
t0021/rot13-filter: improve error message
If there is no new line at the end of something it receives, the packet_txt_read() function die()s, but it's difficult to debug without much context. Let's give a bit more information when that happens. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ed17d26 commit 00df039

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t0021/rot13-filter.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ sub packet_bin_read {
9696
sub packet_txt_read {
9797
my ( $res, $buf ) = packet_bin_read();
9898
unless ( $res == -1 or $buf eq '' or $buf =~ s/\n$// ) {
99-
die "A non-binary line MUST be terminated by an LF.";
99+
die "A non-binary line MUST be terminated by an LF.\n"
100+
. "Received: '$buf'";
100101
}
101102
return ( $res, $buf );
102103
}

0 commit comments

Comments
 (0)