From cac8f33aa766ff776a1815a00122cf76b1a47a7f Mon Sep 17 00:00:00 2001 From: Marvin Flock Date: Wed, 9 Apr 2025 15:38:21 +0200 Subject: [PATCH] fix: add more specific error message to no access method --- src/structure/components/com_sportsmanager/tools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure/components/com_sportsmanager/tools.php b/src/structure/components/com_sportsmanager/tools.php index 6aa2c09..07ac5a9 100644 --- a/src/structure/components/com_sportsmanager/tools.php +++ b/src/structure/components/com_sportsmanager/tools.php @@ -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();