about summary refs log tree commit diff
path: root/app/lib/exceptions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/exceptions.rb')
-rw-r--r--app/lib/exceptions.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/lib/exceptions.rb b/app/lib/exceptions.rb
index 34d84a34f..b2489711d 100644
--- a/app/lib/exceptions.rb
+++ b/app/lib/exceptions.rb
@@ -8,11 +8,11 @@ module Mastodon
 
   class UnexpectedResponseError < Error
     def initialize(response = nil)
-      @response = response
-    end
-
-    def to_s
-      "#{@response.uri} returned code #{@response.code}"
+      if response.respond_to? :uri
+        super("#{response.uri} returned code #{response.code}")
+      else
+        super
+      end
     end
   end
 end