Re: [mediacapture-main] rough draft of new PermissionDeniedError object

> @domenic , we have a need to give back errors that allow Javascript 
to take different decisions based on something predictable

Profuse apologies since I am probably retreading old ground, but can 
you explain why this is? (I.e. the user-facing use case---different UI
 that will be shown, for example.) In contrast, JS does not include a 
way to distinguish between the TypeError caused by trying to call a 
non-function and the TypeError caused by trying to access a property 
of `null`. DOM does not allow distinction between the 
InvalidStateError DOMException caused by dispatching an event twice 
and that caused by using surroundContents() incorrectly. Etc.

If there are such use cases, then perhaps separate errors are the way 
to go; the alternative would be introducing a property like `type` or 
`cause` that takes a string enum, but that might be a bit too ad-hoc. 
(At one time I outlined [vague 
hopes](https://esdiscuss.org/topic/error-objects-in-w3c-apis#content-4)
 for something more comprehensive, but I wouldn't want to make you 
guys the guinea pigs for such a scheme.)

But it's unclear to me why MSE is special such that unlike other web 
specs there's a need to distinguish.

-- 
GitHub Notif of comment by domenic
See 
https://github.com/w3c/mediacapture-main/pull/170#issuecomment-104315973

Received on Thursday, 21 May 2015 15:17:54 UTC