diff --git a/lib/apnserver/server.rb b/lib/apnserver/server.rb index 60cc6c5..582abfb 100644 --- a/lib/apnserver/server.rb +++ b/lib/apnserver/server.rb @@ -25,12 +25,14 @@ def start! begin @client.connect! unless @client.connected? @client.write(notification) - rescue Errno::EPIPE, OpenSSL::SSL::SSLError + rescue Errno::EPIPE, OpenSSL::SSL::SSLError, Errno::ECONNRESET puts "Caught Error, closing connecting and adding notification back to queue" @client.disconnect! @queue.push(notification) rescue RuntimeError => e puts "Unable to handle: #{e}" + rescue Exception => e + puts "Unable to handle: #{e}" end end end