소스 검색

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')