display better exception for traffic results if admin has no customers

This commit is contained in:
envoyr
2022-10-25 13:37:33 +02:00
parent 3acc5457b2
commit 34d5583333
4 changed files with 6 additions and 1 deletions

View File

@@ -37,6 +37,9 @@ if ($page == 'overview' || $page == 'customers') {
try {
$context = Traffic::getCustomerStats($userinfo, $range);
} catch (Exception $e) {
if ($e->getCode() === 405) {
Response::dynamicError(lng('traffic.nocustomers'));
}
Response::dynamicError($e->getMessage());
}