# frozen_string_literal: true {{#generated_src_warning}} {{generated_src_warning}} {{/generated_src_warning}} module {{module_name}} # When {{service_name}} returns an error response, the Ruby SDK constructs and raises an error. # These errors all extend {{module_name}}::Errors::ServiceError < {Aws::Errors::ServiceError} # # You can rescue all {{service_name}} errors using ServiceError: # # begin # # do stuff # rescue {{module_name}}::Errors::ServiceError # # rescues all {{service_name}} API errors # end # # # ## Request Context # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns # information about the request that generated the error. # See {Seahorse::Client::RequestContext} for more information. # # ## Error Classes {{#errors}} {{=<% %>=}} # * {<% name %>} <%={{ }}=%> {{/errors}} # # Additionally, error classes are dynamically generated for service errors based on the error code # if they are not defined above. module Errors extend Aws::Errors::DynamicErrors {{#errors}} class {{name}} < ServiceError # @param [Seahorse::Client::RequestContext] context # @param [String] message # @param [{{data_type}}] data def initialize(context, message, data = Aws::EmptyStructure.new) super(context, message, data) end {{#members}} # @return [{{type}}] def {{name}} {{#shared}}@{{name}} || {{/shared}}@data[:{{name}}] end {{/members}} {{#retryable}} def retryable? true end {{/retryable}} {{#throttling}} def throttling? true end {{/throttling}} end {{/errors}} end end