mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
ImportsourceController: error handling for json
This commit is contained in:
parent
b45d12a85a
commit
1705e2e3e5
@ -188,7 +188,11 @@ 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();
|
||||||
$this->sendJson($this->getResponse(), $data);
|
try {
|
||||||
|
$this->sendJson($this->getResponse(), $data);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->sendJsonError($response, $e->getMessage());
|
||||||
|
}
|
||||||
// TODO: this is not clean
|
// TODO: this is not clean
|
||||||
if (\ob_get_level()) {
|
if (\ob_get_level()) {
|
||||||
\ob_end_flush();
|
\ob_end_flush();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user