Browse files

Make NoResponseError and BadResponseError connection failures compati…

…ble with Ruby 1.9
  • Loading branch information...
1 parent 8c0f454 commit b8e0c80d54ac2e612767754890c97833c98da1ae Jeremy committed Sep 2, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em-imap/connection.rb
View
4 lib/em-imap/connection.rb
@@ -121,9 +121,9 @@ def listen_for_tagged_response(command)
if response.is_a?(Net::IMAP::TaggedResponse) && response.tag == command.tag
case response.name
when "NO"
- command.fail Net::IMAP::NoResponseError.new(response.data.text)
+ command.fail Net::IMAP::NoResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
when "BAD"
- command.fail Net::IMAP::BadResponseError.new(response.data.text)
+ command.fail Net::IMAP::BadResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
else
command.succeed response
end

0 comments on commit b8e0c80

Please sign in to comment.