Exception: Hws::Connectors::Exception::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hws-connectors/exception.rb

Direct Known Subclasses

LowBalance, RatelimitExceeded, UnAuthorized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(err = nil) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
11
12
13
# File 'lib/hws-connectors/exception.rb', line 5

def initialize(err = nil)
  case err.class.name
  when 'Hash'
    @reason = err['reason']
    super(err['message'])
  else
    super(err)
  end
end

Instance Attribute Details

#reasonObject

Returns the value of attribute reason.



3
4
5
# File 'lib/hws-connectors/exception.rb', line 3

def reason
  @reason
end