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,
  ErrorHandler::InvalidRefreshToken,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(array_of_errors) ⇒ Unauthorized

Returns a new instance of Unauthorized.



16
17
18
# File 'lib/rdstation/error_handler/unauthorized.rb', line 16

def initialize(array_of_errors)
  @array_of_errors = array_of_errors
end

Instance Method Details

#raise_errorObject



20
21
22
23
# File 'lib/rdstation/error_handler/unauthorized.rb', line 20

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