Sha256: dbad29ab891676e4464248924541308969474adcc39ec61b48197a0a51d0067b
Contents?: true
Size: 708 Bytes
Versions: 1
Compression:
Stored size: 708 Bytes
Contents
class Dreamcatcher::Monitor attr_reader :configuration, :handlers def initialize(configuration) @configuration = configuration @handlers = build_handlers end def monitor(options = {}, &block) @context = options[:context] || {} logger_proxy = Dreamcatcher::LoggerProxy.new(options[:logger]) logger_proxy.capture { block.call } rescue @configuration.exception_class => exception context = Dreamcatcher::ExceptionContext.new(exception, logger_proxy.log_entries, @context) handlers.each { |handler| handler.handle_exception(context) } raise end protected def build_handlers mailer = Dreamcatcher::Mailer.new(configuration) [mailer] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dreamcatcher-0.0.2 | lib/dreamcatcher/monitor.rb |