Class: RDStation::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/rdstation/error_handler.rb,
lib/rdstation/error_handler/default.rb,
lib/rdstation/error_handler/unauthorized.rb,
lib/rdstation/error_handler/conflicting_field.rb,
lib/rdstation/error_handler/expired_code_grant.rb,
lib/rdstation/error_handler/resource_not_found.rb,
lib/rdstation/error_handler/invalid_credentials.rb,
lib/rdstation/error_handler/expired_access_token.rb

Defined Under Namespace

Classes: ConflictingField, Default, ExpiredAccessToken, ExpiredCodeGrant, InvalidCredentials, ResourceNotFound, Unauthorized

Constant Summary collapse

ERROR_TYPES =
[
  ErrorHandler::ConflictingField,
  ErrorHandler::ExpiredAccessToken,
  ErrorHandler::ExpiredCodeGrant,
  ErrorHandler::InvalidCredentials,
  ErrorHandler::ResourceNotFound,
  ErrorHandler::Unauthorized,
  ErrorHandler::Default
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ErrorHandler

Returns a new instance of ErrorHandler.



22
23
24
# File 'lib/rdstation/error_handler.rb', line 22

def initialize(response)
  @response = response
end

Instance Method Details

#raise_errors ⇒ Object



26
27
28
# File 'lib/rdstation/error_handler.rb', line 26

def raise_errors
  error_types.each(&:raise_error)
end