Skip to content

Commit

Permalink
#534 Let Joomla 4 render errors when JDebug is off
Browse files Browse the repository at this point in the history
  • Loading branch information
amazeika committed Dec 7, 2021
1 parent cb43da9 commit f0b9501
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public function onException(KEvent $event)
$code = '500';
}

$is_joomla4 = version_compare(JVERSION, 4, '>=');

//Render the exception
if(!JDEBUG)
{
//Render the Joomla error page if debug mode is disabled and format is html
if(class_exists('JErrorPage') && $request->getFormat() == 'html')
if(!$is_joomla4 && class_exists('JErrorPage') && $request->getFormat() == 'html')
{
if(ini_get('display_errors')) {
$message = $exception->getMessage();
Expand All @@ -65,6 +67,7 @@ public function onException(KEvent $event)

$class = get_class($exception);
$error = new $class($message, $exception->getCode());

JErrorPage::render($error);

JFactory::getApplication()->close(0);
Expand Down

0 comments on commit f0b9501

Please sign in to comment.