lib/honeycomb/integrations/aws.rb
# Runs a limited subset of response parsing for AWS-specific errors.
#
# Because XML/JSON error handlers are inserted at priority 50 of the
# :sign step, they're upstream from {ApiHandler} (at priority 39), so we
# won't have access to the error saved in Seahorse::Client::Response yet.
# We only have the error in the Seahorse::Client::Http::Response object.
# But Seahorse::Client::NetHttp::Handler only triggers an HTTP response
# error for rescued exceptions (e.g., timeouts). We might still get back
# successful HTTP 3xx, 4xx, or 5xx responses that should be interpreted
# as aws-api errors.
#
# So we have to duplicate the logic of either Aws::Xml::ErrorHandler or
# Aws::Json::ErrorHandler depending on which one is being used by the
# current client. We can determine this by their "protocol" metadata.
#
# Note that there are still a few straggling errors that might occur from
# HTTP 2xx responses. Since those aren't really API call failures, we
# won't worry about parsing them out for the aws-api span. Once the
# upstream handlers process those errors, they'll be propagated to the
# aws-sdk span anyway (since {SdkHandler} will actually have access to
# the Seahorse::Client::Response#error).
#
# @see https://github.com/aws/aws-sdk-ruby/blob/d0c5f6e5a3e83eeda2d1c81f5dd80e5ac562a6dc/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb#L298-L307
# @see https://github.com/aws/aws-sdk-ruby/tree/b0ade445ce18b24c53a4548074b214e732b8b627/gems/aws-sdk-core/lib/aws-sdk-core/plugins/protocols
# @see https://github.com/aws/aws-sdk-ruby/blob/354d36792e47f2e81b4889f322928e848e062818/gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/http_200_errors.rb
# @see https://github.com/aws/aws-sdk-ruby/blob/354d36792e47f2e81b4889f322928e848e062818/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/crc32_validation.rb
Runs a limited subset of response parsing for AWS-specific errors.



Note that there are still a few straggling errors that might occur from
HTTP 2xx responses. Since those aren't really API call failures, we
won't worry about parsing them out for the aws-api span. Once the
upstream handlers process those errors, they'll be propagated to the
aws-sdk span anyway (since {SdkHandler} will actually have access to
the Seahorse::Client::Response#error).
Runs a limited subset of response parsing for AWS - specific errors . Note that there are still a few straggling errors that might occur from HTTP 2xx responses . Since those aren ' t really API call failures we won ' t worry about parsing them out for the aws - api span . Once the upstream handlers process those errors they ' ll be propagated to the aws - sdk span anyway ( since { SdkHandler } will actually have access to the Seahorse :: Client :: Response#error ) .
def parse_api_error_from(context)
        case context.config.api.metadata["protocol"]
        when "query", "rest-xml", "ec2"
          XmlError.new(context)
        when "json", "rest-json"
          JsonError.new(context)
        end
      end
def parse_api_error_from ( context ) case context . config . api . metadata [ "protocol" ] when "query" , "rest-xml" , "ec2" XmlError . new ( context ) when "json" , "rest-json" JsonError . new ( context ) end end
Runs a limited subset of response parsing for AWS-specific errors.
Runs a limited subset of response parsing for AWS - specific errors .
context
<not_specific>
see
None
see
None
see
None
see
None