-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[4.0] Change how uncaught exceptions are processed (#20109)
* Change how uncaught exceptions are processed * Add event to be dispatched on errors, refactor redirect plugin * Declare dependency
- Loading branch information
Showing
9 changed files
with
191 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* Joomla! Content Management System | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
namespace Joomla\CMS\Event; | ||
|
||
defined('JPATH_PLATFORM') or die; | ||
|
||
use Joomla\Application\AbstractApplication; | ||
|
||
/** | ||
* Event class for representing the application's `onError` event | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class ErrorEvent extends AbstractEvent | ||
{ | ||
/** | ||
* Get the event's application object | ||
* | ||
* @return AbstractApplication | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getApplication(): AbstractApplication | ||
{ | ||
return $this->getArgument('application'); | ||
} | ||
|
||
/** | ||
* Get the event's error object | ||
* | ||
* @return \Throwable | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getError(): \Throwable | ||
{ | ||
return $this->getArgument('subject'); | ||
} | ||
|
||
/** | ||
* Set the event's error object | ||
* | ||
* @param \Throwable $error The new error to process | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function setError(\Throwable $error) | ||
{ | ||
$this->setArgument('subject', $error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.