Skip to content

Commit

Permalink
add record invalid rescue on error details creation
Browse files Browse the repository at this point in the history
  • Loading branch information
annvelents committed Jul 23, 2024
1 parent 83534ef commit 8945598
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/error_details/create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module ErrorDetails
class CreateService < BaseService

def call
result = super
return result unless result.success?
Expand All @@ -25,6 +24,8 @@ def create_error_details!
result
rescue ArgumentError => e
result.validation_failure!(errors: e.message)
rescue ActiveRecord::RecordInvalid => e
result.record_validation_failure!(record: e.record)
end
end
end

0 comments on commit 8945598

Please sign in to comment.