Permalink
Browse files

improve nested excepting handling

  • Loading branch information...
1 parent 59619c4 commit dfbea65100904f457cf12bf4953c9de5dc0bc01d @ryanlecompte committed Aug 16, 2012
Showing with 7 additions and 3 deletions.
  1. +4 −0 Changes.md
  2. +3 −3 lib/redis_failover/node.rb
View
@@ -1,3 +1,7 @@
+HEAD
+-----------
+- Improve nested exception handling.
+
0.9.0
-----------
- Make Node Manager's lock path vary with its main znode. (Bira)
@@ -175,14 +175,14 @@ def perform_operation
redis = new_client
yield redis
end
- rescue
- raise NodeUnavailableError, self, caller
+ rescue => ex
+ raise NodeUnavailableError, "#{ex.class}: #{ex.message}", ex.backtrace
ensure
if redis
begin
redis.client.disconnect
rescue
- raise NodeUnavailableError, self, caller
+ raise NodeUnavailableError, "#{ex.class}: #{ex.message}", ex.backtrace
end
end
end

0 comments on commit dfbea65

Please sign in to comment.