瀏覽代碼

Merge pull request #6683 from sebavan/master

error pg
sebavan 6 年之前
父節點
當前提交
7184c1cce2
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Playground/js/indexWebGPU.js

+ 6 - 1
Playground/js/indexWebGPU.js

@@ -4,7 +4,12 @@ var monacoMode = "javascript";
 
 function getRunCode(jsEditor, callBack) {
     var code = jsEditor.getValue();
-    callBack(code);
+    callBack(code).catch((e) => {
+        showError(e);
+
+        // Also log error in console to help debug playgrounds
+        console.error(e);
+    })
 }