瀏覽代碼

Catch recover invocation rejection in splash screen because it calls Throttler#stop.

Afshin T. Darian 6 年之前
父節點
當前提交
2aa927f1b4
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      packages/apputils-extension/src/index.ts

+ 4 - 2
packages/apputils-extension/src/index.ts

@@ -335,7 +335,8 @@ const splash: JupyterFrontEndPlugin<ISplashScreen> = {
 
         // Re-invoke the recovery timer in the next frame.
         requestAnimationFrame(() => {
-          void recovery.invoke();
+          // Because recovery can be stopped, handle invocation rejection.
+          void recovery.invoke().catch(_ => undefined);
         });
       } catch (error) {
         /* no-op */
@@ -352,7 +353,8 @@ const splash: JupyterFrontEndPlugin<ISplashScreen> = {
         splashCount++;
         document.body.appendChild(splash);
 
-        void recovery.invoke();
+        // Because recovery can be stopped, handle invocation rejection.
+        void recovery.invoke().catch(_ => undefined);
 
         return new DisposableDelegate(async () => {
           await restored;