Method: Miasma::Error::ApiError#initialize

Defined in:
lib/miasma/error.rb

#initialize(msg, args = {}) ⇒ ApiError

Create new API error instance

Parameters:

  • msg (String)

    error message

  • args (Hash) (defaults to: {})

    optional arguments

Options Hash (args):

  • :response (HTTP::Response)

    response from request



29
30
31
32
33
34
# File 'lib/miasma/error.rb', line 29

def initialize(msg, args={})
  super
  @response = args.to_smash[:response]
  @message = msg
  extract_error_message(@response)
end