Subject: | error messages contain embedded newline |
% cat foo.pl
#!/usr/bin/perl
use strict;
use warnings;
use IO::Async::Loop;
use Net::Async::HTTP;
use URI;
my $loop = IO::Async::Loop->new();
my $http = Net::Async::HTTP->new();
$loop->add( $http );
$http->do_request(
uri => URI->new( "http://no-such-host./" ),
on_response => sub {
$loop->loop_stop;
die "shouldn't happen";
},
on_error => sub {
my ( $message ) = @_;
print "->{ $message }<-\n";
$loop->loop_stop;
},
);
$loop->loop_forever;
__END__
% perl foo.pl
->{ no-such-host.:80 not resolvable [Name or service not known
] }<-
For some reason there's a \n between "known" and "]" in the error
message that I don't think should be there.