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

Be consistent with error handling #68

Closed
henbos opened this issue Aug 24, 2018 · 5 comments
Closed

Be consistent with error handling #68

henbos opened this issue Aug 24, 2018 · 5 comments
Assignees

Comments

@henbos
Copy link
Contributor

henbos commented Aug 24, 2018

5.2 says to throw an InvalidAccessError if MediaTrackConstraints are used, 5.4 says deviceId can make it overconstrained which I think implies an OverconstrainedError is thrown, and I think other parts of the spec may have implied that unsupported constraints are simply ignored (no exception thrown), but I'm not sure about that last part.

  • We should be consistent with how we handle errors. Should we use different exception types?
  • If an unsupported constraint or a constraint that doesn't make sense, should we always throw an exception? If we throw on deviceId being set we might want to throw on other recognized attributes that aren't supported being set.
@henbos
Copy link
Contributor Author

henbos commented Aug 24, 2018

The "simply ignored" would be from section 5:

Though all constraints are supported for display device capture, not all constraints will have an effect.

@henbos
Copy link
Contributor Author

henbos commented Aug 24, 2018

Also contradiction: clearly not all constraints are supported if some of them throw an exception.

@henbos
Copy link
Contributor Author

henbos commented Aug 30, 2018

I'm trying to be consistent with getUserMedia().

With regards to InvalidAccessError at MediaTrackConstraints, this is throwing an exception because constraints were passed in that weren't applicable. I'm trying to figure out if getUserMedia() in this case would fail to satisfy the constraint because it was not applicable and hence throw an OverconstrainedError (if "exact" was used, but not if "ideal" was used?) or if it would silently ignore the constraint (as if a constraint unrecognized by WebIDL was passed in) and not throw an exception.
I filed w3c/mediacapture-main#533.

@henbos
Copy link
Contributor Author

henbos commented Aug 30, 2018

Is this covered by #73 ?

@aboba aboba changed the title Be consistent with how to handle errors Be consistent with error handling Oct 11, 2018
@henbos henbos removed the TPAC 2018 label Oct 18, 2018
@jan-ivar
Copy link
Member

@henbos Yes I think this is covered by #73, as it explicitly mentions never firing the overconstrained event. Can we close it?

I've opened specific issues on errors: #95 and #96.

@henbos henbos closed this as completed Dec 27, 2018
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

No branches or pull requests

3 participants