Skip to content

Commit

Permalink
add Sentry logging to narrow down failure mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitch-A6 committed Sep 5, 2024
1 parent 4d2ca74 commit 7b15cd2
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions app/controllers/concerns/form_attachment_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@

module FormAttachmentCreate
extend ActiveSupport::Concern
include SentryLogging

def create
validate_file_upload_class!
save_attachment_to_cloud!
save_attachment_to_db!
begin
validate_file_upload_class!
rescue => e
log_exception_to_sentry(e, { context: 'FAC_validate', class: filtered_params[:file_data].class.name })
raise e
end

begin
save_attachment_to_cloud!
rescue => e
log_exception_to_sentry(e, { context: 'FAC_cloud'})

Check failure on line 18 in app/controllers/concerns/form_attachment_create.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
raise e
end

begin
save_attachment_to_db!
rescue => e
log_exception_to_sentry(e, { context: 'FAC_db', errors: form_attachment.errors})

Check failure on line 25 in app/controllers/concerns/form_attachment_create.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
raise e
end

render json: serializer_klass.new(form_attachment)
end
Expand Down

0 comments on commit 7b15cd2

Please sign in to comment.