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

Backwards compat concerns with RTCError #2330

Closed
jan-ivar opened this issue Oct 16, 2019 · 4 comments · Fixed by #2375
Closed

Backwards compat concerns with RTCError #2330

jan-ivar opened this issue Oct 16, 2019 · 4 comments · Fixed by #2375

Comments

@jan-ivar
Copy link
Member

Since no browsers implement RTCError yet, concerns were raised about backwards
compatibility with implementing it.

RTCError is both a type (with extra attributes), as well as the name of the error.

One idea to mitigate compat concerns would be to specify the error names browsers are using today. E.g.:

await pc.setRemoteDescription({type: "offer", sdp: "foo"}); // OperationError

On the upside it solves compat. On the downside, JS that cares about the attributes would need to check for them.

@jan-ivar jan-ivar changed the title Maybe RTCError doesn't have to be named "RTCError" Backwards compat concerns with RTCError Oct 16, 2019
@aboba
Copy link
Contributor

aboba commented Nov 14, 2019

@jan-ivar Your suggestion will remove some of the obstacles to implementation, so it's probably a good idea.

@henbos henbos assigned henbos and unassigned jan-ivar Nov 21, 2019
@henbos
Copy link
Contributor

henbos commented Nov 26, 2019

This removes an obstacle and makes it backwards-compatible. One might argue RTCError is still At risk though, and that the additional fields introduced by it are only useful for debugging if information is provided by the implementation.

Slide added.

@henbos
Copy link
Contributor

henbos commented Nov 26, 2019

FYI it looks like there are other error names than just OperationError, so an RTCError constructor that passes in a name would be needed.

@henbos
Copy link
Contributor

henbos commented Nov 26, 2019

RTCError are per-spec only constructed in these places:

  • RTCDtlsTransport.onerror
  • RTCDataChannel.onerror
  • SLD/SRD
  • replaceTrack

Chrome generally seem to throw OperationError. I saw a case of InvalidModificationError at replaceTrack but I think that's safe to change to OperationError actually because it generally passes.

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

Successfully merging a pull request may close this issue.

3 participants