diff --git a/structure/functions.php b/structure/functions.php index b02a02f4..f0eb2935 100644 --- a/structure/functions.php +++ b/structure/functions.php @@ -135,7 +135,7 @@ function print_ws_structure($wsname, $type, $structure, $useparams) { * Login required: " . ($structure->loginrequired ? 'yes' : 'no');*/ echo " */ -${export}type $type = ".convert_to_ts(null, $typestructure).";\n"; +{$export}type $type = ".convert_to_ts(null, $typestructure).";\n"; } /** diff --git a/structure/ws_functions.php b/structure/ws_functions.php index bbdf3105..367f21b9 100644 --- a/structure/ws_functions.php +++ b/structure/ws_functions.php @@ -35,7 +35,18 @@ function get_all_ws_structures() { $functions = $DB->get_records('external_functions', array('services' => 'moodle_mobile_app'), 'name'); $functiondescs = array(); foreach ($functions as $function) { - $functiondescs[$function->name] = external_api::external_function_info($function); + try { + $functiondescs[$function->name] = external_api::external_function_info($function); + } catch (Exception $e) { + // Fake response to see errors. + $functiondescs[$function->name] = new StdClass(); + $functiondescs[$function->name]->parameters_desc = null; + $functiondescs[$function->name]->returns_desc = null; + $functiondescs[$function->name]->description = $exception->getMessage(); + $functiondescs[$function->name]->loginrequired = null; + $functiondescs[$function->name]->allowed_from_ajax = null; + $functiondescs[$function->name]->readonlysession = null; + } } return $functiondescs;