Exception: BerkeleyLibrary::TIND::API::APIKeyNotSet
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- BerkeleyLibrary::TIND::API::APIKeyNotSet
- Defined in:
- lib/berkeley_library/tind/api/api_exception.rb
Overview
Exception raised when the API key is nil or blank.
NOTE: TIND incorrectly returns 403 Forbidden in this case, but we don't even bother to ask, we just simulate a 401.
Instance Attribute Summary
Attributes inherited from APIException
#params, #response, #status_code, #status_message, #url
Instance Method Summary collapse
-
#initialize(endpoint_uri, params) ⇒ APIKeyNotSet
constructor
A new instance of APIKeyNotSet.
Methods inherited from APIException
Constructor Details
#initialize(endpoint_uri, params) ⇒ APIKeyNotSet
Returns a new instance of APIKeyNotSet.
103 104 105 106 |
# File 'lib/berkeley_library/tind/api/api_exception.rb', line 103 def initialize(endpoint_uri, params) request_str = API.format_request(endpoint_uri, params) super("#{request_str} failed; API key not set", status_code: 401) end |