-
Notifications
You must be signed in to change notification settings - Fork 115
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
DOMException(name=<Exception>) or instances of <Exception>? #1817
Comments
Don't forget that there is also RTCError with errorDetail. Would it be possible to unify these into one type only? |
WebRTC currently has "created OperationError" where "created" is a citation to WebIDL (first time I looked at this it just sent me to [WebIDL] in the references section and not the definition in WebIDL, weirdly?), where the "created" citation does say that it creates a DOMException. I'd strongly recommend following what the DOM spec does, with wording like 'throw a "SyntaxError" DOMException', as this makes it unambiguous that a DOMException is being created/thrown. |
So, if I understand WebIDL correctly, then everything is a |
@lgrahl yes. |
@lgrahl Is there a spec Issue that needs to be addressed? |
Per what I said above,
Only an editorial change, but when that makes things much clearer. |
@aboba No spec issue from my side. However, I agree with @gsnedders some wordsmithing could be applied. Would you like to create a PR for this, @gsnedders? |
Seems a consistency issue. I already see this in the spec: "Reject p with a DOMException object whose name attribute has the value OperationError and abort these steps." - just need to use it consistently. |
As to RTCError that is a new error class (type 2 above) |
@lgrahl I'm unlikely to get around to it, FWIW. |
Okay. FWIW, I can't work on this atm either. |
In #2330 we propose using the old name ('OperationError'), but instanceof RTCError would still be true. Can we close this issue? |
Or we still need to update WPT tests? |
the consistency issue seems to have been addressed. I have marked #2375 with the needs test label; closing that issue |
There are a bunch of exceptions that should be raised in various circumstances defined by the spec. Are these of...
DOMException
with.name
set (to for exampleTypeError
,OperationError
, ...), orTypeError
,OperationError
, etc.Since
OperationError
doesn't seem a valid standalone exception class and we're usingOperationError
in the spec, I would assume 1. is correct.But the WPTs use
TypeError
all the time and there are plenty of tests that pass with this assumption...So, what's correct?
Note: Depending on the outcome of this we should file an issue for WPT and update adapter.
The text was updated successfully, but these errors were encountered: