Sha256: c3daddb8114293401f4d34253deb9c0a72e572806e6f261726a574d7e01d67c5
Contents?: true
Size: 698 Bytes
Versions: 1
Compression:
Stored size: 698 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) 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.1 | lib/dreamcatcher/monitor.rb |