2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

Added verbose error message if connect fails.

git-svn-id: https://svn.fhem.de/fhem/trunk@4002 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2013-10-04 09:47:27 +00:00
parent 6878fbd335
commit 1471381019

View File

@ -90,6 +90,7 @@ CustomGetFileFromURL($$@)
}
my $conn;
my $errstr= "";
if($protocol eq "https") {
eval "use IO::Socket::SSL";
if($@) {
@ -100,9 +101,10 @@ CustomGetFileFromURL($$@)
} else {
$conn = IO::Socket::INET->new(PeerAddr=>"$host:$port", Timeout=>$timeout);
}
$errstr= $@ if(!$conn);
if(!$conn) {
Log3 undef, $loglevel,
"CustomGetFileFromURL $displayurl: Can't connect to $protocol://$host:$port\n";
"CustomGetFileFromURL $displayurl: Can't connect to $protocol://$host:$port, $errstr";
undef $conn;
return undef;
}