mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ImportsourceController: catch the whole block
This commit is contained in:
parent
1705e2e3e5
commit
f2461bb7e9
@ -172,13 +172,13 @@ class ImportsourceController extends ActionController
|
|||||||
*/
|
*/
|
||||||
public function fetchAction()
|
public function fetchAction()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$source = $this->getImportSource();
|
$source = $this->getImportSource();
|
||||||
$source->checkForChanges();
|
$source->checkForChanges();
|
||||||
$hook = ImportSourceHook::forImportSource($source);
|
$hook = ImportSourceHook::forImportSource($source);
|
||||||
$data = $hook->fetchData();
|
$data = $hook->fetchData();
|
||||||
$source->applyModifiers($data);
|
$source->applyModifiers($data);
|
||||||
|
|
||||||
|
|
||||||
$filename = sprintf(
|
$filename = sprintf(
|
||||||
"director-importsource-%d_%s.json",
|
"director-importsource-%d_%s.json",
|
||||||
$this->getParam('id'),
|
$this->getParam('id'),
|
||||||
@ -188,7 +188,6 @@ class ImportsourceController extends ActionController
|
|||||||
$response->setHeader('Content-Type', 'application/json', true);
|
$response->setHeader('Content-Type', 'application/json', true);
|
||||||
$response->setHeader('Content-disposition', "attachment; filename=$filename", true);
|
$response->setHeader('Content-disposition', "attachment; filename=$filename", true);
|
||||||
$response->sendHeaders();
|
$response->sendHeaders();
|
||||||
try {
|
|
||||||
$this->sendJson($this->getResponse(), $data);
|
$this->sendJson($this->getResponse(), $data);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->sendJsonError($response, $e->getMessage());
|
$this->sendJsonError($response, $e->getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user