Show some error page when crash

This commit is contained in:
Ibnu Maksum
2023-09-14 13:45:35 +07:00
parent fc5aa083a1
commit e64527cee2
5 changed files with 72 additions and 44 deletions

View File

@ -17,7 +17,8 @@ class Mikrotik
$iport = explode(":", $ip);
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
$ui->assign("error_meesage", "Unable to connect to the router.<br>" . $e->getMessage());
$ui->assign("error_title", "Mikrotik Connection Error");
$ui->assign("error_message", "Unable to connect to the router.<br>" . $e->getMessage());
$ui->display('router-error.tpl');
die();
}