enable controller based exception handling
This commit is contained in:
parent
3b47f4da05
commit
ae09cf88a5
@ -61,24 +61,34 @@ class d3ActionWizard extends AdminDetailsController
|
||||
public function runTask()
|
||||
{
|
||||
try {
|
||||
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
||||
$action = $this->configuration->getActionById($id);
|
||||
|
||||
[ $queryString, $parameters ] = $action->getQuery();
|
||||
|
||||
if (Registry::getConfig()->getConfigParam('d3datawizard_debug')) {
|
||||
throw oxNew(
|
||||
DebugException::class,
|
||||
d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters)
|
||||
);
|
||||
}
|
||||
|
||||
$action->run();
|
||||
$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');
|
||||
$action = $this->configuration->getActionById($id);
|
||||
|
||||
[ $queryString, $parameters ] = $action->getQuery();
|
||||
|
||||
if (Registry::getConfig()->getConfigParam('d3datawizard_debug')) {
|
||||
throw oxNew(
|
||||
DebugException::class,
|
||||
d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters)
|
||||
);
|
||||
}
|
||||
|
||||
$action->run();
|
||||
}
|
||||
|
||||
public function getUserMessages()
|
||||
{
|
||||
return null;
|
||||
|
@ -18,6 +18,8 @@ namespace D3\DataWizard\Application\Controller\Admin;
|
||||
use D3\DataWizard\Application\Model\Configuration;
|
||||
use D3\DataWizard\Application\Model\Exceptions\DataWizardException;
|
||||
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\Exception\d3_cfg_mod_exception;
|
||||
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
|
||||
@ -61,24 +63,40 @@ class d3ExportWizard extends AdminDetailsController
|
||||
public function runTask()
|
||||
{
|
||||
try {
|
||||
$id = Registry::getRequest()->getRequestEscapedParameter('taskid');
|
||||
$export = $this->configuration->getExportById($id);
|
||||
|
||||
[ $queryString, $parameters ] = $export->getQuery();
|
||||
|
||||
if (Registry::getConfig()->getConfigParam('d3datawizard_debug')) {
|
||||
throw oxNew(
|
||||
DebugException::class,
|
||||
d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters)
|
||||
);
|
||||
}
|
||||
|
||||
$export->run(Registry::getRequest()->getRequestEscapedParameter('format'));
|
||||
$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');
|
||||
$export = $this->configuration->getExportById($id);
|
||||
|
||||
[ $queryString, $parameters ] = $export->getQuery();
|
||||
|
||||
if (Registry::getConfig()->getConfigParam('d3datawizard_debug')) {
|
||||
throw oxNew(
|
||||
DebugException::class,
|
||||
d3database::getInstance()->getPreparedStatementQuery($queryString, $parameters)
|
||||
);
|
||||
}
|
||||
|
||||
$export->run(Registry::getRequest()->getRequestEscapedParameter('format'));
|
||||
}
|
||||
|
||||
public function getUserMessages()
|
||||
{
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user