module ActiveJob::Exceptions::ClassMethods

def discard_on(*exceptions)

end
end
# Might raise CustomAppException for something domain specific
# Will raise ActiveJob::DeserializationError if the record can't be deserialized
def perform(record)

end
ExceptionNotifier.caught(error)
discard_on(CustomAppException) do |job, error|
discard_on ActiveJob::DeserializationError
class SearchIndexingJob < ActiveJob::Base

==== Example

You can also pass a block that'll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter.

like an Active Record, is no longer available, and the job is thus no longer relevant.
Discard the job with no attempts to retry, if the exception is raised. This is useful when the subject of the job,
def discard_on(*exceptions)
  rescue_from(*exceptions) do |error|
    instrument :discard, error: error do
      yield self, error if block_given?
    end
  end
end