Browse Source

show warning to avoid silent promise rejection in edge

Trevor Baron 7 years ago
parent
commit
1423987aeb
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/Loading/babylon.sceneLoader.ts

+ 5 - 3
src/Loading/babylon.sceneLoader.ts

@@ -675,7 +675,7 @@
                 sceneFilename = rootUrl;
                 rootUrl = "";
             }
-
+            
             var loadingToken = {};
             scene._addPendingData(loadingToken);
 
@@ -691,7 +691,7 @@
                     Tools.Error(errorMessage);
                     // should the exception be thrown?
                 }
-
+                
                 disposeHandler();
             };
 
@@ -761,7 +761,9 @@
                 SceneLoader.LoadAssetContainer(rootUrl, sceneFilename, scene, assetContainer => {
                     resolve(assetContainer);
                 }, onProgress, (scene, message, exception) => {
-                    reject(exception || new Error(message));
+                    var error = exception || new Error(message);
+                    Tools.Warn(error);
+                    reject(error);
                 }, pluginExtension);
             });
         }