-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,12 @@ public function __construct($subject, $config = array()) | |
} | ||
|
||
//Bootstrap the Koowa Framework | ||
$this->bootstrap(); | ||
if ($this->bootstrap()) | ||
{ | ||
if (version_compare(JVERSION, '4', '>=') && Koowa::isDebug()) { | ||
$subject->addListener('onError', array($this, 'onJ4Error'), Joomla\Event\Priority::ABOVE_NORMAL); | ||
} | ||
} | ||
|
||
$this->onAfterKoowaBootstrap(); | ||
|
||
|
@@ -239,8 +244,10 @@ public function onBeforeRender() | |
* @see: https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Application/CMSApplication.php#L296 | ||
* @return void | ||
*/ | ||
public function onError($exception) | ||
public function onJ4Error($event) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
amazeika
Author
Member
|
||
{ | ||
$exception = $event->getError(); | ||
|
||
if ($exception instanceof \Throwable) { | ||
$this->_proxyEvent('onException', ['exception' => $exception]); | ||
} | ||
|
@amazeika Is there a specific reason to call this event handler onJ4Error and not call it onError? You are doing:
if (version_compare(JVERSION, '4', '>=') && Koowa::isDebug()) { $subject->addListener('onError', array($this, 'onJ4Error'), Joomla\Event\Priority::ABOVE_NORMAL); }
If Joomla calls onError on system plugins we can just intercept it, implement this check there and then proxy it?