Exception: Idcf::Cli::Error::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/idcf/cli/error/api_error.rb

Overview

api error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ ApiError

Returns a new instance of ApiError.



8
9
10
# File 'lib/idcf/cli/error/api_error.rb', line 8

def initialize(res)
  @responce = res
end

Instance Attribute Details

#responceObject (readonly)

Returns the value of attribute responce.



6
7
8
# File 'lib/idcf/cli/error/api_error.rb', line 6

def responce
  @responce
end

Instance Method Details

#bodyObject



22
23
24
# File 'lib/idcf/cli/error/api_error.rb', line 22

def body
  responce.body
end

#headersObject



26
27
28
# File 'lib/idcf/cli/error/api_error.rb', line 26

def headers
  responce.headers
end

#messageObject



16
17
18
19
20
# File 'lib/idcf/cli/error/api_error.rb', line 16

def message
  msg = super
  return msg unless msg.empty?
  responce.body.to_param
end

#statusObject



12
13
14
# File 'lib/idcf/cli/error/api_error.rb', line 12

def status
  responce.status
end