Selaa lähdekoodia

refactor: add try catch to getILMContent function

lairaalmas 1 vuosi sitten
vanhempi
commit
3e24fac5b7
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  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')