app/models/errdo/error.rb in errdo-0.12.1 vs app/models/errdo/error.rb in errdo-0.12.2
- old
+ new
@@ -15,10 +15,11 @@
before_validation :create_unique_string
validates :backtrace_hash, uniqueness: true
def self.find_or_create(params)
+ params = clean_backtrace(params)
unique_string = create_unique_string_from_params(params)
@error = Errdo::Error.find_by(backtrace_hash: unique_string)
@error = Errdo::Error.create(params) if @error.nil?
@@ -32,9 +33,16 @@
params[:exception_class_name].to_s.last(20)
end
def short_backtrace
backtrace.first if backtrace.respond_to?(:first)
+ end
+
+ def self.clean_backtrace(params)
+ unless params[:backtrace].empty?
+ params[:backtrace][0] = params[:backtrace][0].gsub(/[_]{1,}[0-9]+/, "")
+ end
+ return params
end
private
def create_unique_string