lib/aws/errors.rb
def error_class(error_code)
        constant = error_code.to_s
        constant = constant.gsub(/http:\/\/.*$/, '') # remove http namespaces
        constant = constant.gsub(/[^a-zA-Z0-9]/, '').to_sym
        if error_const_set?(constant)
          const_get(constant)
        else
          set_error_constant(constant)
        end
      end
# Given the name of a service and an error code, this method
# returns an error class (that extends {ServiceError}.
#
#     Aws::S3::Errors.error_class('NoSuchBucket').new
#     #=> #<Aws::S3::Errors::NoSuchBucket>
#
# @api private
Given the name of a service and an error code, this method
returns an error class (that extends {ServiceError}.


Given the name of a service and an error code this method returns an error class ( that extends { ServiceError } .
def error_class(error_code)
        constant = error_code.to_s
        constant = constant.gsub(/http:\/\/.*$/, '') 
        constant = constant.gsub(/[^a-zA-Z0-9]/, '').to_sym
        if error_const_set?(constant)
          const_get(constant)
        else
          set_error_constant(constant)
        end
      end
def error_class ( error_code ) constant = error_code . to_s constant = constant . gsub ( / http: \/ \/ .*$ / , '' ) constant = constant . gsub ( / [^a-zA-Z0-9] / , '' ) . to_sym if error_const_set? ( constant ) const_get ( constant ) else set_error_constant ( constant ) end end
Given the name of a service and an error code, this method
returns an error class (that extends {ServiceError}.
Given the name of a service and an error code this method returns an error class ( that extends { ServiceError } .
# remove http namespaces
error_code
api
None