Commit b10ef30ec214c8eec6112d5f1f155d6a9a9736a7

Authored by Nathan Broadbent
1 parent 804aac2c
Exists in master and in 1 other branch production

Improved error matching by removing fragments from methods (e.g. erb fragment ha…

…shes). Also use first 3 lines of backtrace for fingerprint.
Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
app/models/error_report.rb
... ... @@ -10,7 +10,11 @@ class ErrorReport
10 10 end
11 11  
12 12 def fingerprint
13   - @fingerprint ||= Digest::MD5.hexdigest(backtrace[0].to_s)
  13 + normalized_backtrace = backtrace[0...3].map do |trace|
  14 + trace.merge 'method' => trace['method'].gsub(/[0-9_]{10,}+/, "__FRAGMENT__")
  15 + end
  16 +
  17 + @fingerprint ||= Digest::MD5.hexdigest(normalized_backtrace.to_s)
14 18 end
15 19  
16 20 def rails_env
... ...