- Field error are now all catched as \Throwable

This commit is contained in:
Dave Mc Nicoll 2026-06-17 21:03:19 +00:00
parent f292ac63ca
commit 78670c2fcf

View File

@ -96,8 +96,9 @@ abstract class Save extends Form implements \Picea\Ui\Method\FormInterface {
if ($attribute) {
try {
$attribute->object->assertValueSpecs($context->$name ?? null, ! $this->getEntity()->isLoaded());
} catch (MandatoryFieldException $e) {
throw new MandatoryFieldException("An error occured with field '$name': " . $e->getMessage());
}
catch(\Throwable $ex) {
throw new MandatoryFieldException("An error occured with field '$name': " . $ex->getMessage());
}
}
}