Rescue and warn when graphite connection cannot be opened

This commit updates vmpooler graphite stats behavior when a connection cannot be opened to the graphite server to warn instead of allowing the full backtrace to be output to stderr. Without this change a backtrace is output to stderr when a graphite connection fails.
This commit is contained in:
kirby@puppetlabs.com 2020-06-05 11:27:49 -07:00
parent 9f397f02fb
commit e390efbb10

View file

@ -35,6 +35,8 @@ module Vmpooler
socket.close
end
end
rescue Errno::EADDRNOTAVAIL => e
warn "Could not assign address to graphite server #{server}: #{e}"
rescue StandardError => e
warn "Failure logging #{path} to graphite server [#{server}:#{port}]: #{e}"
end