Exception: FizzyApiClient::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/fizzy_api_client/error.rb

Overview

API returned an error response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, status: nil, body: nil, method: nil, path: nil) ⇒ ApiError

Returns a new instance of ApiError.



20
21
22
23
24
25
26
27
28
# File 'lib/fizzy_api_client/error.rb', line 20

def initialize(message: nil, status: nil, body: nil, method: nil, path: nil)
  @status = status
  @body = body
  @method = method
  @path = path

  error_message = build_message(message)
  super(error_message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



18
19
20
# File 'lib/fizzy_api_client/error.rb', line 18

def body
  @body
end

#methodObject (readonly)

Returns the value of attribute method.



18
19
20
# File 'lib/fizzy_api_client/error.rb', line 18

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



18
19
20
# File 'lib/fizzy_api_client/error.rb', line 18

def path
  @path
end

#statusObject (readonly)

Returns the value of attribute status.



18
19
20
# File 'lib/fizzy_api_client/error.rb', line 18

def status
  @status
end