enable controller based exception handling
This commit is contained in:
parent
3b47f4da05
commit
ae09cf88a5
@ -61,6 +61,19 @@ class d3ActionWizard extends AdminDetailsController
|
|||||||
public function runTask()
|
public function runTask()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$this->execute();
|
||||||
|
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
|
||||||
|
Registry::getLogger()->error($e->getMessage());
|
||||||
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws DatabaseConnectionException
|
||||||
|
* @throws DatabaseErrorException
|
||||||
|
*/
|
||||||
|
protected function execute()
|
||||||
|
{
|
||||||
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
||||||
$action = $this->configuration->getActionById($id);
|
$action = $this->configuration->getActionById($id);
|
||||||
|
|
||||||
@ -74,9 +87,6 @@ class d3ActionWizard extends AdminDetailsController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action->run();
|
$action->run();
|
||||||
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
|
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserMessages()
|
public function getUserMessages()
|
||||||
|
@ -18,6 +18,8 @@ namespace D3\DataWizard\Application\Controller\Admin;
|
|||||||
use D3\DataWizard\Application\Model\Configuration;
|
use D3\DataWizard\Application\Model\Configuration;
|
||||||
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
|
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
|
||||||
use D3\DataWizard\Application\Model\Exceptions\DebugException;
|
use D3\DataWizard\Application\Model\Exceptions\DebugException;
|
||||||
|
use D3\DataWizard\Application\Model\Exceptions\NoSuitableRendererException;
|
||||||
|
use D3\DataWizard\Application\Model\Exceptions\TaskException;
|
||||||
use D3\ModCfg\Application\Model\d3database;
|
use D3\ModCfg\Application\Model\d3database;
|
||||||
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
|
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
|
||||||
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
|
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
|
||||||
@ -61,6 +63,25 @@ class d3ExportWizard extends AdminDetailsController
|
|||||||
public function runTask()
|
public function runTask()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$this->execute();
|
||||||
|
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
|
||||||
|
Registry::getLogger()->error($e->getMessage());
|
||||||
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws DBALException
|
||||||
|
* @throws DatabaseConnectionException
|
||||||
|
* @throws DatabaseErrorException
|
||||||
|
* @throws StandardException
|
||||||
|
* @throws NoSuitableRendererException
|
||||||
|
* @throws TaskException
|
||||||
|
* @throws d3ShopCompatibilityAdapterException
|
||||||
|
* @throws d3_cfg_mod_exception
|
||||||
|
*/
|
||||||
|
protected function execute()
|
||||||
|
{
|
||||||
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
||||||
$export = $this->configuration->getExportById($id);
|
$export = $this->configuration->getExportById($id);
|
||||||
|
|
||||||
@ -74,9 +95,6 @@ class d3ExportWizard extends AdminDetailsController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$export->run(Registry::getRequest()->getRequestEscapedParameter('format'));
|
$export->run(Registry::getRequest()->getRequestEscapedParameter('format'));
|
||||||
} catch (DataWizardException|DBALException|DatabaseErrorException $e) {
|
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserMessages()
|
public function getUserMessages()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user