Browse Source

refactor: add try catch to getILMContent function

lairaalmas 1 year ago
parent
commit
3e24fac5b7
1 changed files with 7 additions and 1 deletions
  1. 7 1
      js/menus/menu_main.js

+ 7 - 1
js/menus/menu_main.js

@@ -16,7 +16,13 @@ const menuState = {
       // Student role
 
       playerName = game.lang.student; // TODO pegar o nome do aluno no bd do moodle
-      getiLMContent();
+      try {
+        getiLMContent();
+      } catch (error) {
+        console.error(
+          'Game error: Could not load the iLM Content on Moodle. ' + error
+        );
+      }
     } else {
       // FOR MOODLE
       if (moodle && iLMparameters.iLM_PARAM_SendAnswer == 'true')