Skip to content

Commit

Permalink
♻️ Fix return value of transaction create
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Mar 8, 2024
1 parent 8c97ba6 commit fb8e944
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/factories/bulkrax/valkyrie_object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,12 @@ def perform_transaction_for(object:, attrs:)
transaction = yield

result = transaction.call(form)
return result unless result.failure?

msg = result.failure[0].to_s
msg += " - #{result.failure[1].full_messages.join(',')}" if result.failure[1].respond_to?(:full_messages)
raise StandardError, msg, result.trace
result.value_or do
msg = result.failure[0].to_s
msg += " - #{result.failure[1].full_messages.join(',')}" if result.failure[1].respond_to?(:full_messages)
raise StandardError, msg, result.trace
end
end

def get_s3_files(remote_files: {})
Expand Down

0 comments on commit fb8e944

Please sign in to comment.