$ex->getMessage(), 'trace' => $ex->getTraceAsString() )); die(); } ob_start(); try { $controller = DUPX_CTRL::getInstance(); $exceptionError = false; // Log::error thotw an exception Log::setThrowExceptionOnError(true); Log::logTime('CONTROLLER START', Log::LV_DETAILED); $controller->mainController(); } catch (Exception $e) { SnapUtil::obCleanAll(false); $controller->setExceptionPage($e); } /** * clean output */ $unespectOutput = trim(ob_get_clean()); ob_end_clean(); if (!empty($unespectOutput)) { Log::info('ERROR: Unespect output ' . Log::v2str($unespectOutput)); $exceptionError = new Exception('Unespected output ' . Log::v2str($unespectOutput)); $controller->setExceptionPage($exceptionError); } ob_start(); try { echo $controller->renderPage(); } catch (Exception $e) { SnapUtil::obCleanAll(false); ob_end_clean(); $controller->setExceptionPage($e); echo $controller->renderPage(); }