Class: Honeycomb::Aws::ApiHandler::JsonError
- Inherits:
-
Aws::Json::ErrorHandler
- Object
- Aws::Json::ErrorHandler
- Honeycomb::Aws::ApiHandler::JsonError
- Defined in:
- lib/honeycomb/integrations/aws.rb
Overview
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(context) ⇒ JsonError
constructor
A new instance of JsonError.
Constructor Details
#initialize(context) ⇒ JsonError
Returns a new instance of JsonError.
298 299 300 301 302 303 304 305 306 |
# File 'lib/honeycomb/integrations/aws.rb', line 298 def initialize(context) body = context.http_response.body_contents json = ::Aws::Json.load(body) || {} @code = error_code(json, context) @message = (code, json) rescue ::Aws::Json::ParseError @code = http_status_error_code(context) @message = "" end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
296 297 298 |
# File 'lib/honeycomb/integrations/aws.rb', line 296 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
296 297 298 |
# File 'lib/honeycomb/integrations/aws.rb', line 296 def @message end |