class Aws::Plugins::ClientMetricsSendPlugin::ErrorHandler

Public Instance Methods

call(context) click to toggle source
# File lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb, line 74
def call(context)
  resp = @handler.call(context)
  call_attempt = context.metadata[:current_call_attempt]
  if (e = resp.error)
    e_name = _extract_error_name(e)
    e_msg = e.message
    call_attempt.aws_exception = "#{e_name}"
    call_attempt.aws_exception_msg = "#{e_msg}"
  end
  resp
end

Private Instance Methods

_extract_error_name(error) click to toggle source
# File lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb, line 88
def _extract_error_name(error)
  if error.is_a?(Aws::Errors::ServiceError)
    error.class.code
  else
    error.class.name.to_s
  end
end