Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit d358d67d authored by Francois Gannaz's avatar Francois Gannaz
Browse files

addInstance(): better handling of lnb API error

parent fb91dabf
...@@ -70,7 +70,11 @@ function labnbook_add_instance($moduleinstance, $mform = null) { ...@@ -70,7 +70,11 @@ function labnbook_add_instance($moduleinstance, $mform = null) {
} catch (\Exception $e) { } catch (\Exception $e) {
die("fatal error: " . $e->getMessage()); // TODO die("fatal error: " . $e->getMessage()); // TODO
} }
$moduleinstance->labnbook_teamconfigid = (int) $teamConfig->id_team_config; if ($teamConfig->id_team_config) {
$moduleinstance->labnbook_teamconfigid = (int) $teamConfig->id_team_config;
} else {
throw new moodle_exception("LabnBook return an invalid response.");
}
$moduleinstance->timecreated = time(); $moduleinstance->timecreated = time();
$id = $DB->insert_record(LABNBOOK_TABLE, $moduleinstance); $id = $DB->insert_record(LABNBOOK_TABLE, $moduleinstance);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment