[Xfce4-commits] <eatmonkey:aria2-xml-rpc> Emit "disconnected" signal on unhandled exceptions

Mike Massonnet noreply at xfce.org
Sat Jan 30 15:12:04 CET 2010


Updating branch refs/heads/aria2-xml-rpc
         to 2ca9b6dfb912bb0d686cdc66fdc30271e55154a9 (commit)
       from ac73d2895a4e0ee8d57486b5c0fe06ca2f108bca (commit)

commit 2ca9b6dfb912bb0d686cdc66fdc30271e55154a9
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Sat Jan 30 13:45:19 2010 +0100

    Emit "disconnected" signal on unhandled exceptions

 src/eataria2.rb |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/eataria2.rb b/src/eataria2.rb
index 7d0ce70..b790065 100644
--- a/src/eataria2.rb
+++ b/src/eataria2.rb
@@ -159,21 +159,22 @@ class Eat::Aria2 < GLib::Object
 			debug("XMLRPC server didn't support the request")
 			puts e.message
 		rescue Errno::EPIPE => e
-			# Connection interrupted/timed out/server shutdown/etc
+			# Connection interrupted
 			debug("EPIPE", $!)
 			# Try to reconnect if it was successfully connected previously
 			connect(true) if @is_connected
 			return nil if !@is_connected
 			result = call(method, args)
 		rescue Errno::ECONNREFUSED => e
-			# Connection refused/no service listening
+			# Connection refused
 			debug("ECONNREFUSED", $!)
 			signal_emit("disconnected")
 			return nil if start_server <= 0
 			result = call(method, args)
 		rescue Exception => e
-			# Unhandled exception
+			# Unhandled exception, no service listening/host unreachable/timed out/etc
 			debug("unhandled exception in call", $!)
+			signal_emit("disconnected")
 		end
 		result
 	end



More information about the Xfce4-commits mailing list