class Aws::SessionStore::DynamoDB::Errors::DefaultHandler

This class handles errors raised from DynamoDB.

def errors_string(error)

Returns string to be placed in error stream
def errors_string(error)
  str = []
  str << "Exception occurred: #{error.message}"
  str << "Stack trace:"
  str += error.backtrace.map {|l| "  " + l }
  str.join("\n")
end

def handle_error(error, env = {})

Places all other errors in Racks error stream.
Raises {HARD_ERRORS} up the Rack stack.
def handle_error(error, env = {})
  if HARD_ERRORS.include?(error.class) || @raise_errors
    raise error
  else
    store_error(error, env)
    false
  end
end

def initialize(raise_errors)

Parameters:
  • raise_errors (true) -- Pass all errors up the Rack stack.
def initialize(raise_errors)
  @raise_errors = raise_errors
end

def store_error(error, env = {})

Sends error to error stream
def store_error(error, env = {})
  env["rack.errors"].puts(errors_string(error)) if env
end