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 call(async_logging: Config.async_logging, tag: nil, **error_attrs)
        return unless should_create?
        if async_logging
          ::ExceptionHunter::AsyncLoggingJob.perform_later(tag, error_attrs.merge(occurred_at: Time.now.to_i))
        else
          create_error(tag, **error_attrs)
        end
      rescue ActiveRecord::RecordInvalid
        false
      end
def call ( async_logging : Config . async_logging , tag : nil , ** error_attrs ) return unless should_create? if async_logging :: ExceptionHunter :: AsyncLoggingJob . perform_later ( tag , error_attrs . merge ( occurred_at : Time . now . to_i ) ) else create_error ( tag , ** error_attrs ) end rescue ActiveRecord :: RecordInvalid false 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 .
# Time is sent in unix format and then converted to Time to avoid ActiveJob::SerializationError
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
async_logging
<not_specific>
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