Created
May 3, 2025 00:53
-
-
Save lazaronixon/a1ac2969828e0e1caec73aaad1c3473c to your computer and use it in GitHub Desktop.
Active job report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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