We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20563d0 commit 04810a0Copy full SHA for 04810a0
1 file changed
lib/LWP/Protocol/http.pm
@@ -40,8 +40,14 @@ sub _new_socket
40
41
unless ($sock) {
42
# IO::Socket::INET leaves additional error messages in $@
43
- $@ =~ s/^.*?: //;
44
- die "Can't connect to $host:$port ($@)";
+ my $status = "Can't connect to $host:$port";
+ if ($@ =~ /\bconnect: (.*)/ ||
45
+ $@ =~ /\b(Bad hostname)\b/ ||
46
+ $@ =~ /\b(certificate verify failed)\b/
47
+ ) {
48
+ $status .= " ($1)";
49
+ }
50
+ die "$status\n\n$@";
51
}
52
53
# perl 5.005's IO::Socket does not have the blocking method.
0 commit comments