mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
QuickForm: catch Exceptions from success handlers
This commit is contained in:
parent
0544be3aec
commit
7693192e66
@ -8,6 +8,7 @@ use Icinga\Exception\ProgrammingError;
|
|||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
use Icinga\Web\Request;
|
use Icinga\Web\Request;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
|
use Exception;
|
||||||
use Zend_Form;
|
use Zend_Form;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -300,7 +301,12 @@ abstract class QuickForm extends Zend_Form
|
|||||||
if ($this->hasBeenSubmitted()) {
|
if ($this->hasBeenSubmitted()) {
|
||||||
$this->beforeValidation($post);
|
$this->beforeValidation($post);
|
||||||
if ($this->isValid($post)) {
|
if ($this->isValid($post)) {
|
||||||
$this->onSuccess();
|
try {
|
||||||
|
$this->onSuccess();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->addError($e->getMessage());
|
||||||
|
$this->onFailure();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->onFailure();
|
$this->onFailure();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user