Преглед на файлове

refactor: add try catch to getILMContent function

lairaalmas преди 1 година
родител
ревизия
3e24fac5b7
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  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')