Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enterVR: reject promise if xr.requestSession fails #5382

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

JL-Vidinoti
Copy link
Contributor

Description:

When calling enterVR (or enterAR), the function navigator.xr.requestSession may fail (e.g. if the user denied the required permissions). In this case, an error is thrown but it is impossible to catch it.

Changes proposed:

  • Instead of simply throwing the error, the returned promise is rejected with the error.

@dmarcos
Copy link
Member

dmarcos commented Nov 14, 2023

Thanks. Just curious. In what context did you find this an issue? Might inform other decisions. Thanks!

@dmarcos dmarcos merged commit e96e30e into aframevr:master Nov 14, 2023
1 check passed
@dmarcos
Copy link
Member

dmarcos commented Nov 14, 2023

Congrats on your first contribution!

@JL-Vidinoti
Copy link
Contributor Author

I discovered the issue while doing some tests in AR. When denying the Chrome permission, the AR mode was not starting and no error message was displayed.
Now I will be able to catch the error and show a message for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants