Permalink
Browse files

Raise a wrapped network error if not threaded

  • Loading branch information...
1 parent 5e39924 commit 3f89a8d8a2d01ace99fe606d6a72835d37057eb8 @gdb gdb committed Jan 18, 2013
Showing with 11 additions and 0 deletions.
  1. +9 −0 lib/bunny/exceptions.rb
  2. +2 −0 lib/bunny/session.rb
View
@@ -136,4 +136,13 @@ class InvalidCommand < ConnectionLevelException
class UnexpectedFrame < ConnectionLevelException
end
+
+ class NetworkErrorWrapper < StandardError
+ attr_reader :other
+
+ def initialize(other)
+ super(other.message)
+ @other = other
+ end
+ end
end
View
@@ -309,6 +309,8 @@ def handle_frameset(ch_number, frames)
end
def handle_network_failure(exception)
+ raise NetworkErrorWrapper.new(exception) unless @threaded
+
if !recovering_from_network_failure?
@recovering_from_network_failure = true
if recoverable_network_failure?(exception)

0 comments on commit 3f89a8d

Please sign in to comment.