Class: RailsErrorDashboard::Subscribers::IssueTrackerSubscriber
- Inherits:
-
Object
- Object
- RailsErrorDashboard::Subscribers::IssueTrackerSubscriber
- Defined in:
- lib/rails_error_dashboard/subscribers/issue_tracker_subscriber.rb
Overview
Hooks into the error lifecycle to trigger issue tracker jobs.
Called from the engine initializer via direct integration with the LogError and ResolveError commands’ callback mechanisms.
All work is done via background jobs — never blocks the capture path.
Class Method Summary collapse
-
.on_error_logged(error_log) ⇒ Object
Called when a new error is first logged.
-
.on_error_recurred(error_log) ⇒ Object
Called when an existing error occurs again.
-
.on_error_reopened(error_log) ⇒ Object
Called when a resolved error recurs (auto-reopened).
-
.on_error_resolved(error_log) ⇒ Object
Called when an error is resolved in the dashboard.
Class Method Details
.on_error_logged(error_log) ⇒ Object
Called when a new error is first logged
14 15 16 17 18 19 20 |
# File 'lib/rails_error_dashboard/subscribers/issue_tracker_subscriber.rb', line 14 def on_error_logged(error_log) return unless should_auto_create?(error_log) dashboard_url = Services::NotificationHelpers.dashboard_url(error_log) CreateIssueJob.perform_later(error_log.id, dashboard_url: dashboard_url) rescue => e nil end |
.on_error_recurred(error_log) ⇒ Object
Called when an existing error occurs again
32 33 34 35 36 37 38 |
# File 'lib/rails_error_dashboard/subscribers/issue_tracker_subscriber.rb', line 32 def on_error_recurred(error_log) return unless error_log.external_issue_url.present? return unless RailsErrorDashboard.configuration.enable_issue_tracking AddIssueRecurrenceCommentJob.perform_later(error_log.id) rescue => e nil end |
.on_error_reopened(error_log) ⇒ Object
Called when a resolved error recurs (auto-reopened)
23 24 25 26 27 28 29 |
# File 'lib/rails_error_dashboard/subscribers/issue_tracker_subscriber.rb', line 23 def on_error_reopened(error_log) return unless error_log.external_issue_url.present? return unless RailsErrorDashboard.configuration.enable_issue_tracking ReopenLinkedIssueJob.perform_later(error_log.id) rescue => e nil end |
.on_error_resolved(error_log) ⇒ Object
Called when an error is resolved in the dashboard
41 42 43 44 45 46 47 |
# File 'lib/rails_error_dashboard/subscribers/issue_tracker_subscriber.rb', line 41 def on_error_resolved(error_log) return unless error_log.external_issue_url.present? return unless RailsErrorDashboard.configuration.enable_issue_tracking CloseLinkedIssueJob.perform_later(error_log.id) rescue => e nil end |