Sha256: d963d2d6333536542d3a2565317495c83ff0ea0dcacbd61071edda35c076fdd4
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
require 'mongo' module YogiBerra class Data def self.store!(exception, environment, client) data = parse_exception(exception) if environment session = environment.delete(:session) data[:session] = parse_session(session) if session data.merge!(environment) end client["caught_exceptions"].insert(data) end def self.parse_exception(notice) puts YogiBerra::Catcher.settings["project"].inspect data_hash = { :error_class => notice.error_class, :project => YogiBerra::Catcher.settings["project"], :error_message => notice.error_message } if notice.backtrace.lines.any? data_hash[:backtraces] = notice.backtrace.lines.collect(&:to_s) end data_hash[:created_at] = Time.now.utc data_hash end def self.parse_session(session) session.inject({}) do |result, element| result[element.first] = element.last.respond_to?(:as_json) ? element.last.as_json(:except => ["password"]) : element.last result end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
yogi_berra-0.0.2 | lib/yogi_berra/data.rb |