Exception: Chatrix::AuthenticationError
- Inherits:
-
ApiError
- Object
- StandardError
- ChatrixError
- ApiError
- Chatrix::AuthenticationError
- Defined in:
- lib/chatrix/errors.rb
Overview
Raised when there is an issue with authentication.
This can either be because authentication failed outright or because more information is required by the server to successfully authenticate.
If authentication failed then the data
attribute will be an empty hash.
If more information is required the data
hash will contain information
about what additional information is needed to authenticate.
Instance Attribute Summary collapse
-
#data ⇒ Hash
readonly
A hash with information about the additional information required by the server for authentication, if any.
Attributes inherited from ApiError
Instance Method Summary collapse
-
#initialize(error = {}) ⇒ AuthenticationError
constructor
Initializes a new AuthenticationError instance.
Constructor Details
#initialize(error = {}) ⇒ AuthenticationError
Initializes a new AuthenticationError instance.
116 117 118 119 120 121 122 123 |
# File 'lib/chatrix/errors.rb', line 116 def initialize(error = {}) super # Set data to be the error response hash WITHOUT the error code and # error values. This will leave it with only the data relevant for # handling authentication. @data = error.select { |key| !%w(errcode error).include? key } end |
Instance Attribute Details
#data ⇒ Hash (readonly)
Returns a hash with information about the additional information
required by the server for authentication, if any. If the
authentication request failed, this will be an empty hash or nil
.
112 113 114 |
# File 'lib/chatrix/errors.rb', line 112 def data @data end |