Class: RDStation::ErrorHandler::Unauthorized

Inherits:
Object
  • Object
show all
Defined in:
lib/rdstation/error_handler/unauthorized.rb

Constant Summary collapse

UNAUTHORIZED_ERRORS =
[
  ErrorHandler::ExpiredAccessToken,
  ErrorHandler::ExpiredCodeGrant,
  ErrorHandler::InvalidCredentials,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(array_of_errors) ⇒ Unauthorized

Returns a new instance of Unauthorized.



14
15
16
# File 'lib/rdstation/error_handler/unauthorized.rb', line 14

def initialize(array_of_errors)
  @array_of_errors = array_of_errors
end

Instance Method Details

#raise_errorObject



18
19
20
21
# File 'lib/rdstation/error_handler/unauthorized.rb', line 18

def raise_error
  error_classes.each(&:raise_error)
  raise RDStation::Error::Unauthorized, @array_of_errors.first
end