fix: add more specific error message to no access method

This commit is contained in:
Marvin Flock
2025-04-09 15:38:21 +02:00
parent a589ca8337
commit cac8f33aa7
@@ -41,8 +41,8 @@ class MathParserSM extends MathParser
abortWithError(401 . ' Unauthorized');
}
if (!$login || Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id) {
Log::add('an error occurred', Log::ERROR, 'com_sportsmanager');
throw new RuntimeException('An error occurred.', 500);
Log::add('Unauthorized user with id ' . Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id, Log::WARNING, 'com_sportsmanager');
throw new RuntimeException('´Not authorized!', 401);
}
$version = new Version();
$joomla = $version->getShortVersion();