Exception: Sudhanva::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sudhanva/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, code:, message:, body:) ⇒ APIError

Returns a new instance of APIError.



13
14
15
16
17
18
# File 'lib/sudhanva/client.rb', line 13

def initialize(status:, code:, message:, body:)
  super("#{status} #{code}: #{message}")
  @status = status
  @code = code
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



11
12
13
# File 'lib/sudhanva/client.rb', line 11

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



11
12
13
# File 'lib/sudhanva/client.rb', line 11

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/sudhanva/client.rb', line 11

def status
  @status
end