lib/ruby-box/exceptions.rb in ruby-box-1.11.0 vs lib/ruby-box/exceptions.rb in ruby-box-1.11.1
- old
+ new
@@ -1,8 +1,12 @@
module RubyBox
class RubyBoxError < StandardError
- def initialize(error_json)
+ attr_accessor :body, :status
+
+ def initialize(error_json, status, body)
+ @status = status
+ @body = body
@error_json = error_json
end
def [](key)
@error_json[key]
@@ -10,9 +14,9 @@
end
class ObjectNotFound < StandardError; end
class AuthError < RubyBoxError; end
class RequestError < RubyBoxError; end
- class ServerError < StandardError; end
+ class ServerError < RubyBoxError; end
class ItemNameInUse < RubyBoxError; end
class UnshareableResource < StandardError; end
end