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

Need an error for "User refused permission" #95

Closed
alvestrand opened this issue Mar 3, 2016 · 17 comments
Closed

Need an error for "User refused permission" #95

alvestrand opened this issue Mar 3, 2016 · 17 comments

Comments

@alvestrand
Copy link

In #85, a new "not allowed" error was added. The description says:

"The request is not allowed by the user agent or the platform in the current context."

This does not include the user refusing permission.
We (WEBRTC) have been using SecurityError for this, and were considering switching to this one, (w3c/mediacapture-main#317) - but the description doesn't allow it to be used for users' refusal to allow.

Should we either add an UserRefusedPermission error, or change the description of this one?

@beverloo
Copy link
Member

beverloo commented Mar 5, 2016

The Push API defines a PermissionDeniedError that'd we also like to use in background sync. Could we perhaps adopt that one in WebIDL?

https://w3c.github.io/push-api/#dfn-permissiondeniederror

/cc @nicolassatragno @jkarlin

@tobie
Copy link
Collaborator

tobie commented Mar 18, 2016

Note BackgroundSync defines it too.

@jan-ivar
Copy link
Contributor

The user agent is an agent of the user, is that not sufficient? If a web page could know for certain that the user is the obstacle, then it could pester the user.

@Ms2ger
Copy link
Member

Ms2ger commented Mar 19, 2016

I think you're reading the description in an overly narrow way. Using NotAllowedError seems perfectly fine to me.

@tobie
Copy link
Collaborator

tobie commented Mar 19, 2016

Yes. Given how many editors are rolling their own PermissionDeniedError, paving the cow-path might be the right thing to do, though.

@alvestrand
Copy link
Author

I'd prefer to fix this problem by improving the description. Having more error codes that mean almost the same thing is bad for the platform.
The reason for my original formulation is that 1) I don't know what the WebIDL authors intended about users, and 2) I don't want to dictate which way they choose to fix this. The important thing is that it gets fixed.

@mounirlamouri
Copy link
Member

Using NotAllowedError sgtm. We might want to update the description if it is considered not good enough.

@binarykitchen
Copy link

hello guys, i just landed here from a google search and would like to know where i can look up what the error message "The request is not allowed by the user agent or the platform in the current context." really means.

for my www.videomail.io app i am trying to rephrase it so that it becomes more human friendly to read.

@tobie
Copy link
Collaborator

tobie commented Apr 26, 2017

@binarykitchen: that's going to be context dependant. But probably something to do with the user refusing to give permission to access an API.

@binarykitchen
Copy link

@tobie thanks - if this is w3c specified, can i know the link?

i really need to know, not "probably" :) this because traffic is high on that site and such an unclear error message can impact usability ...

@tobie
Copy link
Collaborator

tobie commented Apr 26, 2017

@binarykitchen it's the NotAllowedError. It's used in multiple specs. It's generally related to users refusing to give permission to use a particular API. Think you want to look for APIs that require user permission and see where you're not catching errors (rejected promises?) properly.

@tobie
Copy link
Collaborator

tobie commented Apr 26, 2017

Here's where it's used in Mozilla src code: http://searchfox.org/mozilla-central/search?q=notallowederror.

@binarykitchen
Copy link

@tobie i've been investigating. there have been Error objects with the name PERMISSION_DENIED in the past. do they mean the same?

@tobie
Copy link
Collaborator

tobie commented Apr 29, 2017

They were specific to geolocation.

@binarykitchen
Copy link

geolocation? huh, i cannot follow ...

@tobie
Copy link
Collaborator

tobie commented Apr 29, 2017

@binarykitchen
Copy link

ah, weird, that's something totally different. alright, i ll ignore that for now then. thanks for the links @tobie

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

No branches or pull requests

7 participants