Skip to content

Commit

Permalink
Add busgnag logging when tooling writing fails (#6131)
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD authored Sep 8, 2023
1 parent 908510c commit 2580b8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/commands/submission/representation/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ def handle_create!
ActiveRecord::Base.transaction do
handle_generated!
end
rescue StandardError
rescue StandardError => e
raise unless Rails.env.production?

# Alert bugsnag and mark as exceptioned
Bugsnag.notify(e)

# Reload the record here to ensure # that it hasn't got
# in a bad state in the transaction above.
submission.reload.representation_exceptioned!
Expand Down
4 changes: 3 additions & 1 deletion app/commands/submission/test_run/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def call
else
raise "Unknown status"
end
rescue StandardError
rescue StandardError => e
# Alert bugsnag and mark as exceptioned
Bugsnag.notify(e)
update_status!(:exceptioned)
end

Expand Down

0 comments on commit 2580b8f

Please sign in to comment.