-
Bug
-
Resolution: Fixed
-
Minor
-
3.2.3
-
MOODLE_32_STABLE
-
MOODLE_32_STABLE
-
MDL-58843-master-exchandler -
I have discovered this while debugging MDLSITE-5026. On moodle.net, we have error_log records like
PHP Fatal error: Uncaught TypeError: Argument 1 passed to webservice_xmlrpc_server::generate_error() must be an instance of Exception, instance of Error given, called in /var/www/vhosts/moodle.net/html/webservice/xmlrpc/locallib.php on line 139 and defined in /var/www/vhosts/moodle.net/html/webservice/xmlrpc/locallib.php:170
|
|
Stack trace
|
#0 /var/www/vhosts/moodle.net/html/webservice/xmlrpc/locallib.php(139): webservice_xmlrpc_server->generate_error(Object(Error))
|
#1 /var/www/vhosts/moodle.net/html/webservice/lib.php(1245): webservice_xmlrpc_server->send_error(Object(Error))
|
#2 [internal function]: webservice_base_server->exception_handler(Object(Error))
|
#3 {main}\n thrown in /var/www/vhosts/moodle.net/html/webservice/xmlrpc/locallib.php on line 170
|
As documented at http://php.net/manual/en/function.set-exception-handler.php, starting with PHP 7 the custom exception handlers are passed with Error instances beside the Exception instances (both of them implement Throwable).
I suggest to do what PHPUnit did (https://github.com/sebastianbergmann/phpunit/commit/c3db067ba2f64843d6038c6dc9c51eca794f5e06) and get rid of the Exception type declaration in the handler signature.
- will help resolve
-
MDLSITE-5026 Not possible to upload courses to Moodle.net
- Resolved