From 1614e3e52b36d8165ac386bc53f2316462793539 Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Mon, 6 Feb 2023 16:42:48 +0100 Subject: [PATCH] Fix hound [SCI-7831] --- app/services/protocol_importers/import_protocol_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/protocol_importers/import_protocol_service.rb b/app/services/protocol_importers/import_protocol_service.rb index e689bd9d6..248ce6112 100644 --- a/app/services/protocol_importers/import_protocol_service.rb +++ b/app/services/protocol_importers/import_protocol_service.rb @@ -43,8 +43,8 @@ module ProtocolImporters step.assets << AttachmentsBuilder.generate(step_params.deep_symbolize_keys, user: @user, team: @team) step end - rescue ActiveRecord::RecordInvalid => invalid - @errors[:protocol] = invalid.record.errors + rescue ActiveRecord::RecordInvalid => e + @errors[:protocol] = e.record.errors rescue StandardError => e @errors[:protocol] = e.message end