lib/instrumental/agent.rb in instrumental_agent-0.13.2 vs lib/instrumental/agent.rb in instrumental_agent-0.13.3

- old
+ new

@@ -497,10 +497,12 @@ !@thread.nil? && @pid == Process.pid && @thread.alive? end def flush_socket(socket) socket.flush + rescue Exception => e + logger.error "Error flushing socket, #{e.message}" end def disconnect if connected? logger.info "Disconnecting..." @@ -511,9 +513,12 @@ rescue Timeout::Error logger.info "Timed out flushing socket..." end @socket.close end + rescue Exception => e + logger.error "Error closing socket, #{e.message}" + ensure @socket = nil end def allows_secure? defined?(OpenSSL)