MDL-58843 core: Do not expect a particular class of the thrown exception
Since PHP 7, the custom exception handlers are also called to handle thrown Errors which are not Exceptions.
This commit is contained in:
@@ -94,9 +94,9 @@ class service_exception_handler {
|
||||
/**
|
||||
* Echo an exception message encapsulated in XML.
|
||||
*
|
||||
* @param \Exception $exception The exception that was thrown
|
||||
* @param \Exception|\Throwable $exception The exception that was thrown
|
||||
*/
|
||||
public function handle(\Exception $exception) {
|
||||
public function handle($exception) {
|
||||
$message = $exception->getMessage();
|
||||
|
||||
// Add the exception backtrace for developers.
|
||||
|
||||
Reference in New Issue
Block a user