-
Notifications
You must be signed in to change notification settings - Fork 37
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
Clarify promise rejection value #76
Comments
We should definutely return better DOMExceptions, but I don't think we want to touch DataTransfer. E.g., the spec should be updated to read:
While the spec currently uses a DataTransfer object for |
@garykac |
Re: "NotAllowedError", see the comments here for the recommendation to use this for denied requests. Questions about the appropriateness of DataTransfer came about before the TAG review because it doesn't quite match what we'll need to do for the clipboard:
We could hack these things on top of DataTransfer, but that's not necessarily the best approach. |
I'm a bit unsure of what to expect back from the async clipboard API when there is a failure. The
explainer.adoc
here doesn't use the rejection value at all, and the spec simply says "reject |p|".clipboard-apis/index.bs
Line 676 in 2ac3c0b
Is the intention that the Promise should simply reject with the value
undefined
instead of anError
instance?This is how we have interpreted it here: feross/clipboard-copy#24
I feel that this goes against best practices, and I think there is a ton of code in the wild that does something similar to:
Wouldn't it be nice to reject with an error, maybe
reject(new Error('Persmission for writing to clipboard was not granted'))
?The text was updated successfully, but these errors were encountered: