Sha256: 22c4a3ad266cbf2206807f4f0cde97b4b60c11c0bc04ad2d0eb06c373408d3e8

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module Aws::SessionStore::DynamoDB::Errors
  # BaseErrorHandler provides an interface for error handlers
  # that can be passed in to {Aws::SessionStore::DynamoDB::RackMiddleware}.
  # Each error handler must implement a handle_error method.
  #
  # @example Sample ErrorHandler class
  #   class MyErrorHandler < BaseHandler
  #    # Handles error passed in
  #    def handle_error(e, env = {})
  #      File.open(path_to_file, 'w') {|f| f.write(e.message) }
  #      false
  #    end
  #   end
  class BaseHandler
    # An error and an environment (optionally) will be passed in to
    # this method and it will determine how to deal
    # with the error.
    # Must return false if you have handled the error but are not re-raising the
    # error up the stack.
    # You may reraise the error passed.
    #
    # @param [Aws::DynamoDB::Errors::Base] error error passed in from
    #  Aws::SessionStore::DynamoDB::RackMiddleware.
    # @param [Rack::Request::Environment,nil] env Rack environment
    # @return [false] If exception was handled and will not reraise exception.
    # @raise [Aws::DynamoDB::Errors] If error has be re-raised.
    def handle_error(error, env = {})
      raise NotImplementedError
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aws-sessionstore-dynamodb-3.0.1 lib/aws/session_store/dynamo_db/errors/base_handler.rb