lib/exception_hunter/error_creator.rb
# Creates an error with the given attributes and persists it to
# the database.
#
# @param [HTTP_TAG, WORKER_TAG, MANUAL_TAG] tag to append to the error if any
# @return [ExceptionHunter::Error, false] the error or false if it was not possible to create it
Creates an error with the given attributes and persists it to
the database.
Creates an error with the given attributes and persists it to the database .
def create_error(tag, **error_attrs)
        ActiveRecord::Base.transaction do
          error_attrs = extract_user_data(**error_attrs)
          error_attrs = hide_sensitive_values(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!
          unless error_group.ignored?
            notify(error)
            error
          end
        end
      end
def create_error ( tag , ** error_attrs ) ActiveRecord :: Base . transaction do error_attrs = extract_user_data ( ** error_attrs ) error_attrs = hide_sensitive_values ( 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! unless error_group . ignored? notify ( error ) error end end end
Creates an error with the given attributes and persists it to
the database.
Creates an error with the given attributes and persists it to the database .
the error or false if it was not possible to create it
the error or false if it was not possible to create it
ExceptionHunter::Error, false
tag
<not_specific>
error_attrs
<not_specific>
<not_specific>
tag to append to the error if any
tag to append to the error if any