Exception: Telesocial::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/telesocial/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response) ⇒ Error



5
6
7
8
# File 'lib/telesocial/errors.rb', line 5

def initialize(message, response)
  @response = response
  super(info(message, response))
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/telesocial/errors.rb', line 3

def response
  @response
end

Instance Method Details

#info(text = '', env = Hashie::Mash.new) ⇒ Object



10
11
12
# File 'lib/telesocial/errors.rb', line 10

def info(text = '', env = Hashie::Mash.new)
  "#{text} - (server message: #{env.message})"
end