fix error make loop

This commit is contained in:
Ibnu Maksum 2024-06-16 16:19:55 +07:00
parent 2f967b6717
commit b0b49b3763
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 6 additions and 38 deletions

View File

@ -8,41 +8,9 @@
try { try {
require_once 'init.php'; require_once 'init.php';
} catch (Throwable $e) { } catch (Throwable $e) {
$ui = new Smarty(); die($e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
$ui->setTemplateDir([
'custom' => File::pathFixer($UI_PATH . '/ui_custom/'),
'default' => File::pathFixer($UI_PATH . '/ui/')
]);
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->setCompileDir(File::pathFixer($UI_PATH . '/compiled/'));
$ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/'));
$ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/'));
$ui->assign("error_title", "PHPNuxBill Crash");
if (_auth()) {
$ui->assign("error_message", $e->getMessage() . '<br>');
} else {
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
}
$ui->display('router-error.tpl');
die();
} catch (Exception $e) { } catch (Exception $e) {
$ui = new Smarty(); die($e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
$ui->setTemplateDir([
'custom' => File::pathFixer($UI_PATH . '/ui_custom/'),
'default' => File::pathFixer($UI_PATH . '/ui/')
]);
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->setCompileDir(File::pathFixer($UI_PATH . '/compiled/'));
$ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/'));
$ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/'));
$ui->assign("error_title", "PHPNuxBill Crash");
if (_auth()) {
$ui->assign("error_message", $e->getMessage() . '<br>');
} else {
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
}
$ui->display('router-error.tpl');
die();
} }
function _notify($msg, $type = 'e') function _notify($msg, $type = 'e')