Leave original ValidationException intact in write()

If we want DataObject->validate() to be used instead of
the form layer, we should allow for validation errors
to be passed through unchanged to the controller layer
so we can present them to the user. The context of
which class is written should be apparent from the stacktrace
of the exception.
This commit is contained in:
Ingo Schommer 2013-12-11 00:41:05 +01:00
parent 3566581a86
commit be5484b1d2

View File

@ -1125,7 +1125,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
if (!$valid->valid()) { if (!$valid->valid()) {
$writeException = new ValidationException( $writeException = new ValidationException(
$valid, $valid,
"Validation error writing a $this->class object: " . $valid->message() . ". Object not written.", $valid->message(),
E_USER_WARNING E_USER_WARNING
); );
} }