Permalink
Browse files

Make NoResponseError and BadResponseError connection failures compati…

…ble with Ruby 1.9
  • Loading branch information...
1 parent b8e0c80 commit 6fcb72893336fc9c2dc962ca4ea1f996b03e73af Jeremy committed Sep 8, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em-imap/connection.rb
@@ -44,7 +44,7 @@ def listen_for_greeting
if response.is_a?(Net::IMAP::UntaggedResponse) && response.name != "BYE"
hello_listener.succeed response
else
- hello_listener.fail Net::IMAP::ResponseParseError.new(response.raw_data)
+ hello_listener.fail Net::IMAP::ResponseParseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
end
end.errback do |e|
hello_listener.fail e
@@ -155,7 +155,7 @@ def listen_for_failure
# to hear any more, so we fail all our listeners.
add_response_handler do |response|
if response.is_a?(Net::IMAP::UntaggedResponse) && response.name == "BYE"
- fail Net::IMAP::ByeResponseError.new(response.raw_data)
+ fail Net::IMAP::ByeResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
end
end
end

0 comments on commit 6fcb728

Please sign in to comment.