Skip to content

Instantly share code, notes, and snippets.

@lazaronixon
Created May 3, 2025 00:53
Show Gist options
  • Save lazaronixon/a1ac2969828e0e1caec73aaad1c3473c to your computer and use it in GitHub Desktop.
Save lazaronixon/a1ac2969828e0e1caec73aaad1c3473c to your computer and use it in GitHub Desktop.
Active job report
# Job
discard_on CustomAppException, report: true
# In config/initializers/error_reporting.rb
class ErrorSubscriber
def report(error, handled:, severity:, context:)
if context[:source] == "application.active_job"
Sentry.capture_exception(error, extra: context)
end
end
end
# Register the subscriber
Rails.error.subscribe(ErrorSubscriber.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment