MDL-67189 external: Catch Throwable in call_external_function
authorDani Palou <dani@moodle.com>
Wed, 12 Feb 2020 09:14:52 +0000 (10:14 +0100)
committerDani Palou <dani@moodle.com>
Tue, 10 Mar 2020 07:26:43 +0000 (08:26 +0100)
lib/externallib.php

index e6d5e99..c5cd8e7 100644 (file)
@@ -252,7 +252,7 @@ class external_api {
 
             $response['error'] = false;
             $response['data'] = $result;
 
             $response['error'] = false;
             $response['data'] = $result;
-        } catch (Exception $e) {
+        } catch (Throwable $e) {
             $exception = get_exception_info($e);
             unset($exception->a);
             $exception->backtrace = format_backtrace($exception->backtrace, true);
             $exception = get_exception_info($e);
             unset($exception->a);
             $exception->backtrace = format_backtrace($exception->backtrace, true);