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

Fix error message handling in getusermedia/gum. #1664

Merged
merged 2 commits into from
May 29, 2024

Conversation

bc-lee
Copy link
Contributor

@bc-lee bc-lee commented May 26, 2024

Description

Currently, when some errors occur in the getusermedia/gum demo, the error message isn't handled correctly because the constraints object might not have required properties in some cases. This patch fixes the error message handling by using the error object directly and dumping it as a JSON string.

Purpose

Currently, when some errors occur in the getusermedia/gum demo,
the error message isn't handled correctly because the constraints object
might not have required properties in some cases. This patch fixes
the error message handling by using the error object directly and
dumping it as a JSON string.
@fippo
Copy link
Collaborator

fippo commented May 28, 2024

I assume this only happens if one manually sets the video constraints to cause an overconstrained error.

Can you revert to using errorMsg and (for consistency) prefix with the error name in addition to the somewhat helpful error message?

@bc-lee
Copy link
Contributor Author

bc-lee commented May 28, 2024

I assume this only happens if one manually sets the video constraints to cause an overconstrained error.

I encountered this issue without modifying the constraints. I was testing Linux WebKitGTK to see if media capture streams (and WebRTC) were working. Its implementation seems to be buggy, as I got an OverconstrainedError when trying to get the video stream, even though I didn't set any constraints.

@fippo fippo merged commit 9db4d1d into webrtc:gh-pages May 29, 2024
3 checks passed
@fippo
Copy link
Collaborator

fippo commented May 29, 2024

Thank you! Maybe @philn knows more about what WebKitGTK might be doing in wrong ways, it did show this code was wrong which is 👍

@bc-lee bc-lee deleted the feature/fix-error-message branch May 29, 2024 01:37
@philn
Copy link

philn commented May 29, 2024

That demo works just fine in my development build.

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.

3 participants