class Pwwka::ErrorHandlers::BaseErrorHandler

Public Instance Methods

handle_error(receiver,queue_name,payload,delivery_info,exception) click to toggle source
# File lib/pwwka/error_handlers/base_error_handler.rb, line 5
def handle_error(receiver,queue_name,payload,delivery_info,exception)
  raise "subclass must implement"
end

Private Instance Methods

abort_chain() click to toggle source
# File lib/pwwka/error_handlers/base_error_handler.rb, line 28
def abort_chain
  false
end
keep_going() click to toggle source

Subclasses can call these methods instead of using true/false to more clearly indicate their intent

# File lib/pwwka/error_handlers/base_error_handler.rb, line 24
def keep_going
  true
end
log(message,queue_name,payload,delivery_info,exception) click to toggle source
# File lib/pwwka/error_handlers/base_error_handler.rb, line 11
def log(message,queue_name,payload,delivery_info,exception)
  logf "%{message} on %{queue_name} -> %{payload}, %{routing_key}: %{exception}: %{backtrace}", {
    message: message,
    queue_name: queue_name,
    payload: payload,
    routing_key: delivery_info.routing_key,
    exception: exception,
    backtrace: exception.backtrace.join(";"),
  }
end