check error Database

This commit is contained in:
Ibnu Maksum 2023-09-14 13:53:28 +07:00
parent e64527cee2
commit a85ccf06fa
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 45 additions and 32 deletions

View File

@ -10,6 +10,7 @@
- Fix Customer counter in dashboard
- Show Customer Balance in header
- Fix Plugin Manager using Http::Get
- Show Some error page when crash
## 2023.9.7
- Fix PPPOE Delete Customer

View File

@ -73,6 +73,7 @@ function _get($param, $defvalue = '')
return safedata($_GET[$param]);
}
}
try {
require_once File::pathFixer('system/orm.php');
@ -107,6 +108,18 @@ if ($config['radius_mode']) {
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
ORM::configure('return_result_sets', true, 'radius');
}
} catch (Exception $e) {
$ui = new Smarty();
$ui->setTemplateDir(['custom' => File::pathFixer('ui/ui_custom/'), 'default' => File::pathFixer('ui/ui/')]);
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->setCompileDir(File::pathFixer('ui/compiled/'));
$ui->setConfigDir(File::pathFixer('ui/conf/'));
$ui->setCacheDir(File::pathFixer('ui/cache/'));
$ui->assign("error_title", "PHPNuxBill Crash");
$ui->assign("error_message", $e->getMessage());
$ui->display('router-error.tpl');
die();
}
function _notify($msg, $type = 'e')
{
@ -323,7 +336,6 @@ try {
} else {
r2(U . 'dashboard', 'e', 'not found');
}
} catch (Exception $e) {
$ui->assign("error_title", "PHPNuxBill Crash");
$ui->assign("error_message", $e->getMessage());