Exception: VCAP::Services::Api::ServiceGatewayClient::ErrorResponse
- Inherits:
-
StandardError
- Object
- StandardError
- VCAP::Services::Api::ServiceGatewayClient::ErrorResponse
- Defined in:
- lib/services/api/clients/service_gateway_client.rb
Overview
Public: Indicate an error response from gateway
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, error) ⇒ ErrorResponse
constructor
status - the http status error - a ServiceErrorResponse object.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(status, error) ⇒ ErrorResponse
status - the http status error - a ServiceErrorResponse object
31 32 33 34 |
# File 'lib/services/api/clients/service_gateway_client.rb', line 31 def initialize(status, error) @status = status @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
26 27 28 |
# File 'lib/services/api/clients/service_gateway_client.rb', line 26 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
26 27 28 |
# File 'lib/services/api/clients/service_gateway_client.rb', line 26 def status @status end |
Instance Method Details
#to_h ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/services/api/clients/service_gateway_client.rb', line 40 def to_h { 'error' => error.extract(stringify_keys: true).merge( 'backtrace' => backtrace, 'types' => self.class.ancestors.map(&:name) - Exception.ancestors.map(&:name) ) } end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/services/api/clients/service_gateway_client.rb', line 36 def to_s "#{self.class.name}: #{error.description}" end |