class Chatrix::AuthenticationError

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.

Attributes

data[R]

@return [Hash] 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`.

Public Class Methods

new(error = {}) click to toggle source

Initializes a new AuthenticationError instance. @param error [Hash] The error response from the server.

Calls superclass method Chatrix::ApiError::new
# 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