From be6944dd5a8a813773f6b70a97cff1b1199d80b7 Mon Sep 17 00:00:00 2001 From: Johan Leuenberger Date: Tue, 14 Nov 2023 10:52:53 +0100 Subject: [PATCH] enterVR: reject promise if xr.requestSession fails --- src/core/scene/a-scene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/scene/a-scene.js b/src/core/scene/a-scene.js index 9025196ed86..b5e2c116704 100644 --- a/src/core/scene/a-scene.js +++ b/src/core/scene/a-scene.js @@ -308,7 +308,7 @@ class AScene extends AEntity { function requestFail (error) { var useAR = xrMode === 'immersive-ar'; var mode = useAR ? 'AR' : 'VR'; - throw new Error('Failed to enter ' + mode + ' mode (`requestSession`) ' + error); + reject(new Error('Failed to enter ' + mode + ' mode (`requestSession`)', { cause: error })); } ); });