Exception: Sqwiggle::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sqwiggle/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



8
9
10
11
12
13
14
# File 'lib/sqwiggle/error.rb', line 8

def initialize(response)
  h = JSON.parse(response.body)
  @status = response.status
  @type = h['type']
  @param = h['param']
  super(message)
end

Instance Attribute Details

#error_typeObject (readonly)

Returns the value of attribute error_type.



5
6
7
# File 'lib/sqwiggle/error.rb', line 5

def error_type
  @error_type
end

#paramObject (readonly)

Returns the value of attribute param.



6
7
8
# File 'lib/sqwiggle/error.rb', line 6

def param
  @param
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/sqwiggle/error.rb', line 4

def status
  @status
end