lib/acfs/errors.rb in acfs-0.11.0 vs lib/acfs/errors.rb in acfs-0.12.0

- old
+ new

@@ -8,16 +8,24 @@ # Response error containing the responsible response object. # class ErroneousResponse < Error attr_accessor :response - def initialize(response) - self.response = response + def initialize(data = {}) + self.response = data[:response] end end # Resource not found error raised on a 404 response # class ResourceNotFound < ErroneousResponse end + class InvalidResource < ErroneousResponse + attr_accessor :errors + + def initialize(data) + self.errors = data[:errors] + super + end + end end