Status: report errors on socket creation problems

If the socket couldn't be created (e.g. FQDN not resolvable) we
continued witouth any hint, when actualy writing the data we then
die'd. The user then does not really know why, so report errors
if the socket creation failed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2016-05-20 12:07:39 +02:00 committed by Dietmar Maurer
parent 4caf47e9e2
commit f014da61c5
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ sub write_graphite_hash {
PeerAddr => $host,
PeerPort => $port,
Proto => 'udp',
);
) || die "couldn't create carbon socket [$host]:$port - $@\n";
write_graphite($carbon_socket, $d, $ctime, $path.".$object");

View File

@ -92,7 +92,7 @@ sub write_influxdb_hash {
PeerAddr => $host,
PeerPort => $port,
Proto => 'udp',
);
) || die "couldn't create influxdb socket [$host]:$port - $@\n";
$socket->send($payload->{string});
$socket->close() if $socket;