Sha256: e7c3de395c9035e3028c43063fc6785613cb51a4931028018a6a09cbca20d8db
Contents?: true
Size: 697 Bytes
Versions: 7
Compression:
Stored size: 697 Bytes
Contents
module BugHunter class Middleware def initialize(app) @app = app end def call(env) response = nil begin response = @app.call(env) rescue StandardError, LoadError, SyntaxError => e error = BugHunter::Error.build_from(env, e) if !error.valid? && !error.errors[:uniqueness].empty? BugHunter::Error.collection.update(error.unique_error_selector, {:$inc => {:times => 1}, :$set => {:updated_at => Time.now.utc}}, {:multi => true}) else error.save end raise e end response end end end
Version data entries
7 entries across 7 versions & 1 rubygems