MDL-67189 external: Catch Throwable in call_external_function
[moodle.git] / 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);