Exception: CompaniesHouseGateway::APIError
- Inherits:
-
CompaniesHouseGatewayError
- Object
- StandardError
- CompaniesHouseGatewayError
- CompaniesHouseGateway::APIError
- Defined in:
- lib/companies_house_gateway/errors/api_error.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
Returns the value of attribute error_code.
Attributes inherited from CompaniesHouseGatewayError
#message, #response_body, #status
Instance Method Summary collapse
-
#initialize(message = nil, error_code = nil, status = nil, response_body = nil) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
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(=nil, error_code=nil, status=nil, response_body=nil) super(, status, response_body) @error_code = error_code end |
Instance Attribute Details
#error_code ⇒ Object
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_s ⇒ Object
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 |