8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/exception_hunter/error_creator.rb', line 8
def call(tag: nil, **error_attrs)
return unless should_create?
ActiveRecord::Base.transaction do
error_attrs = (error_attrs)
error = ::ExceptionHunter::Error.new(error_attrs)
error_group = ::ExceptionHunter::ErrorGroup.find_matching_group(error) || ::ExceptionHunter::ErrorGroup.new
update_error_group(error_group, error, tag)
error.error_group = error_group
error.save!
error
end
rescue ActiveRecord::RecordInvalid
false
end
|