mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 01:06:04 +00:00
HttpUtils.pm: Report error earlier (Forum #27565)
git-svn-id: https://svn.fhem.de/fhem/trunk@6686 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c4002b1cd1
commit
ddaad27799
@ -149,6 +149,8 @@ HttpUtils_Connect($)
|
||||
} else {
|
||||
$hash->{conn} = IO::Socket::INET->new(
|
||||
PeerAddr=>"$host:$port", Timeout=>$hash->{timeout});
|
||||
return "$hash->{displayurl}: Can't connect(1) to $hash->{addr}: $@"
|
||||
if(!$hash->{conn});
|
||||
}
|
||||
return HttpUtils_Connect2($hash);
|
||||
}
|
||||
@ -172,8 +174,8 @@ HttpUtils_Connect2($)
|
||||
if(!$hash->{conn}) {
|
||||
undef $hash->{conn};
|
||||
my $err = $@;
|
||||
$err = "$SSL_ERR" if(!$err && $hash->{protocol} eq "https");
|
||||
return "$hash->{displayurl}: Can't connect to $hash->{addr}: $err";
|
||||
$err = $SSL_ERR if(!$err && $hash->{protocol} eq "https");
|
||||
return "$hash->{displayurl}: Can't connect(2) to $hash->{addr}: $err";
|
||||
}
|
||||
|
||||
my $data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user