Skip to content

Commit a4a90e3

Browse files
committed
Report job errors to AppSignal
1 parent 37fbfd6 commit a4a90e3

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ GEM
155155
railties (>= 5)
156156
drb (2.2.1)
157157
erubi (1.12.0)
158-
et-orbi (1.2.9)
158+
et-orbi (1.2.10)
159159
tzinfo
160160
factory_bot (6.4.6)
161161
activesupport (>= 5.0.0)
@@ -446,7 +446,7 @@ GEM
446446
stimulus-rails (1.3.3)
447447
railties (>= 6.0.0)
448448
stringio (3.1.0)
449-
stripe (10.12.0)
449+
stripe (10.13.0)
450450
tailwindcss-rails (2.3.0-aarch64-linux)
451451
railties (>= 6.0.0)
452452
tailwindcss-rails (2.3.0-arm64-darwin)
@@ -465,7 +465,7 @@ GEM
465465
concurrent-ruby (~> 1.0)
466466
unicode-display_width (2.5.0)
467467
uri (0.13.0)
468-
version_gem (1.1.3)
468+
version_gem (1.1.4)
469469
warden (1.2.9)
470470
rack (>= 2.0.9)
471471
web-console (4.2.1)

Procfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
web: RUBY_DEBUG_OPEN=true bin/rails s -p 3000
1+
web: RUBY_DEBUG_OPEN=true RUBY_DEBUG_SESSION_NAME=rails bin/rails s -p 3000
22
css: bin/rails tailwindcss:watch
3-
solid_queue: RUBY_DEBUG_OPEN=true bundle exec rake solid_queue:start
3+
solid_queue: RUBY_DEBUG_OPEN=true RUBY_DEBUG_SESSION_NAME=solid_queue bundle exec rake solid_queue:start

app/jobs/application_job.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# frozen_string_literal: true
22

33
class ApplicationJob < ActiveJob::Base
4-
# Automatically retry jobs that encountered a deadlock
54
retry_on ActiveRecord::Deadlocked
65

7-
# Most jobs are safe to ignore if the underlying records are no longer available
86
discard_on ActiveJob::DeserializationError, ActiveStorage::IntegrityError
7+
8+
rescue_from(Exception) do |exception|
9+
Appsignal.send_error(exception)
10+
raise exception
11+
end
912
end

app/jobs/screenshot_taker_job.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
class ScreenshotTakerJob < ApplicationJob
66
queue_as :low
77

8-
rescue_from(ActiveJob::DeserializationError) do
9-
true
10-
end
11-
128
def perform(shot)
139
return if shot.screenshot?
1410

app/mailers/application_mailer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ class ApplicationMailer < ActionMailer::Base
77
layout "mailer"
88
helper_method :notification_exists?
99

10+
rescue_from(Exception) do |exception|
11+
Appsignal.send_error(exception)
12+
raise exception
13+
end
14+
1015
private
1116

1217
def check_subscription

0 commit comments

Comments
 (0)