lib/routemaster/errors.rb in routemaster-drain-2.0.0 vs lib/routemaster/errors.rb in routemaster-drain-2.2.2
- old
+ new
@@ -7,11 +7,11 @@
@env = env
super(message)
end
def errors
- body['errors']
+ body.fetch('errors', {})
end
def message
raise NotImplementedError
end
@@ -25,47 +25,47 @@
def deserialized_body
@env.body.empty? ? {} : JSON.parse(@env.body)
end
end
- class UnauthorizedResourceAccessError < BaseError
+ class UnauthorizedResourceAccess < BaseError
def message
"Unauthorized Resource Access Error"
end
end
- class InvalidResourceError < BaseError
+ class InvalidResource < BaseError
def message
"Invalid Resource Error"
end
end
- class ResourceNotFoundError < BaseError
+ class ResourceNotFound < BaseError
def message
"Resource Not Found Error"
end
end
- class FatalResourceError < BaseError
+ class FatalResource < BaseError
def message
"Fatal Resource Error. body: #{body}, url: #{env.url}, method: #{env.method}"
end
end
- class ConflictResourceError < BaseError
+ class ConflictResource < BaseError
def message
"ConflictResourceError Resource Error"
end
end
- class IncompatibleVersionError < BaseError
+ class IncompatibleVersion < BaseError
def message
headers = env.request_headers.select { |k, _| k != 'Authorization' }
"Incompatible Version Error. headers: #{headers}, url: #{env.url}, method: #{env.method}"
end
end
- class ResourceThrottlingError < BaseError
+ class ResourceThrottling < BaseError
def message
"Resource Throttling Error"
end
end
end