lib/embedly/exceptions.rb in embedly-1.3.0 vs lib/embedly/exceptions.rb in embedly-1.4.0

- old
+ new

@@ -1,7 +1,20 @@ class Embedly::BadResponseException < RuntimeError - attr_accessor :response + attr_accessor :response, :path - def initialize response + def initialize(response, path = nil) @response ||= response + @path ||= path + end + + def message + "Bad Response : #{@response.inspect} for path: #{@path.inspect}" + end + + def inspect + self.message + end + + def to_s + self.message end end