class Chatrix::ApiError

Errors that stem from an API call.

Attributes

api_message[R]

@return [String] the error message returned from the server.

`'Unknown error'` if the server did not give any message.
code[R]

@return [String] the type of error. `'E_UNKNOWN'` if the server

did not give an error code.
error[R]

@return [Hash] the raw error response object.

Public Class Methods

new(error = {}) click to toggle source

Initializes a new RequestError instance. @param error [Hash{String=>String}] The error response object.

# File lib/chatrix/errors.rb, line 24
def initialize(error = {})
  @error = error
  @code = error['errcode'] || 'E_UNKNOWN'
  @api_message = error['error'] || 'Unknown error'
end