Exception: CompaniesHouseGateway::APIError

Inherits:
CompaniesHouseGatewayError show all
Defined in:
lib/companies_house_gateway/errors/api_error.rb

Instance Attribute Summary collapse

Attributes inherited from CompaniesHouseGatewayError

#message, #response_body, #status

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, error_code = nil, status = nil, response_body = nil) ⇒ APIError

Returns a new instance of APIError.



5
6
7
8
# File 'lib/companies_house_gateway/errors/api_error.rb', line 5

def initialize(message=nil, error_code=nil, status=nil, response_body=nil)
  super(message, status, response_body)
  @error_code = error_code
end

Instance Attribute Details

#error_codeObject

Returns the value of attribute error_code.



3
4
5
# File 'lib/companies_house_gateway/errors/api_error.rb', line 3

def error_code
  @error_code
end

Instance Method Details

#to_sObject



10
11
12
13
14
# File 'lib/companies_house_gateway/errors/api_error.rb', line 10

def to_s
  str = super
  str += " [Error code: #{error_code}]" if error_code
  str
end