diff options
author | Chad Woolley <thewoolleyman@gmail.com> | 2009-10-04 01:50:47 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-10-08 10:45:00 -0700 |
commit | 32cea98c3b5bd077692f5b20756e0e3c75e0c524 (patch) | |
tree | 4378c2f7f7e165d350b282f2fe1e14afa8d9891c /activeresource/lib | |
parent | 28bd0873ff7aae8e5949dc77f1f8b78109cd38f1 (diff) | |
download | rails-32cea98c3b5bd077692f5b20756e0e3c75e0c524.tar.gz rails-32cea98c3b5bd077692f5b20756e0e3c75e0c524.tar.bz2 rails-32cea98c3b5bd077692f5b20756e0e3c75e0c524.zip |
Ruby 1.9: Fix ActiveResource::ConnectionError#to_s when @response does not respond to #code or #message
Signed-off-by: Carl Lerche <carllerche@mac.com>
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/exceptions.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/exceptions.rb b/activeresource/lib/active_resource/exceptions.rb index 0631cdcf9f..0f4549fd73 100644 --- a/activeresource/lib/active_resource/exceptions.rb +++ b/activeresource/lib/active_resource/exceptions.rb @@ -8,7 +8,10 @@ module ActiveResource end def to_s - "Failed with #{response.code} #{response.message if response.respond_to?(:message)}" + message = "Failed." + message << " Response code = #{response.code}." if response.respond_to?(:code) + message << " Response message = #{response.message}." if response.respond_to?(:message) + message end end |