module YmlErrorResponder::ErrorHandlers

Public Instance Methods

handler(error, payload) click to toggle source
# File lib/yml_error_responder/error_handlers.rb, line 9
def handler(error, payload)
  lookup_handler(error).new(error, payload)
end
unknown_error() click to toggle source
# File lib/yml_error_responder/error_handlers.rb, line 5
def unknown_error
  UnknowErrorHandler.new
end

Private Instance Methods

lookup_handler(error) click to toggle source
# File lib/yml_error_responder/error_handlers.rb, line 15
def lookup_handler(error)
  "::ErrorHandlers::#{error.class.to_s}".constantize
rescue
  DefaultErrorHandler
end