Exception: Genius::Errors::TokenError
- Inherits:
-
GeniusExceptionSuperClass
- Object
- StandardError
- GeniusExceptionSuperClass
- Genius::Errors::TokenError
- Defined in:
- lib/genius/api/errors.rb
Overview
A TokenError
object provides handling error during token validation. It throws error when token
is invalid - expired, revoked or something else. To generate new token you should go to genius.com/signup_or_login and login, then you need to create new client via the link below: genius.com/api-clients and generate new access token. Fields to create new api client can be filled in as you like - there is no restrictions and standards.
Instance Attribute Summary collapse
-
#exception_type ⇒ Object
readonly
Returns the value of attribute exception_type.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
Instance Method Summary collapse
Constructor Details
#initialize(msg: "Invalid token. The access token provided is expired, revoked, malformed or invalid for " \ "other reasons.", exception_type: "token_error", method_name: nil) ⇒ String (frozen)
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/genius/api/errors.rb', line 65 def initialize(msg: "Invalid token. The access token provided is expired, revoked, malformed or invalid for " \ "other reasons.", exception_type: "token_error", method_name: nil) @msg = if method_name.nil? msg else "#{msg} or type #{method_name}(token: \"YOUR_TOKEN\")" end @exception_type = exception_type super(msg) end |
Instance Attribute Details
#exception_type ⇒ Object (readonly)
Returns the value of attribute exception_type.
60 61 62 |
# File 'lib/genius/api/errors.rb', line 60 def exception_type @exception_type end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
60 61 62 |
# File 'lib/genius/api/errors.rb', line 60 def method_name @method_name end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
60 61 62 |
# File 'lib/genius/api/errors.rb', line 60 def msg @msg end |