Exception: Astroboa::ClientError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/astroboa-rb/clienterror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, api_code = nil, api_response = nil) ⇒ ClientError

Returns a new instance of ClientError.



21
22
23
24
25
# File 'lib/astroboa-rb/clienterror.rb', line 21

def initialize message = nil, api_code = nil, api_response = nil  
  @message = message
  @api_code = api_code
  @api_response = api_response
end

Instance Attribute Details

#api_codeObject

Returns the value of attribute api_code.



18
19
20
# File 'lib/astroboa-rb/clienterror.rb', line 18

def api_code
  @api_code
end

#api_responseObject

Returns the value of attribute api_response.



18
19
20
# File 'lib/astroboa-rb/clienterror.rb', line 18

def api_response
  @api_response
end

#messageObject



35
36
37
# File 'lib/astroboa-rb/clienterror.rb', line 35

def message
  @message || self.class.name
end

Instance Method Details

#inspectObject



27
28
29
# File 'lib/astroboa-rb/clienterror.rb', line 27

def inspect
  "#{message}: #{api_response}"
end

#to_sObject



31
32
33
# File 'lib/astroboa-rb/clienterror.rb', line 31

def to_s
  inspect
end