lib/sequel/model/exceptions.rb in sequel-3.8.0 vs lib/sequel/model/exceptions.rb in sequel-3.9.0

- old
+ new

@@ -1,7 +1,17 @@ module Sequel # This exception will be raised when raise_on_save_failure is set and validation fails - class ValidationFailed < Error; end + class ValidationFailed < Error + def initialize(errors) + if errors.respond_to?(:full_messages) + @errors = errors + super(errors.full_messages.join(', ')) + else + super + end + end + attr_reader :errors + end # This exception will be raised when raise_on_save_failure is set and a before hook returns false class BeforeHookFailed < Error; end end