Re: [webauthn] feature policy integration (#1214)

>One issue is that [iUVPAA()](http://w3c.github.io/webauthn/#isUserVerifyingPlatformAuthenticatorAvailable) returns a boolean -- can that also be morphed into an error code? [Promises are only sposed to _return_ errors, not throw them](https://www.w3.org/2001/tag/doc/promises-guide#always-return-promises). First parag is unchanged, only added the Note:

I don't think that is a problem. The guideline you quote says that any _function_ that returns a promise should always return a promise and never throw an exception, but a promise can be either _resolved_ with a success value or _rejected_ with a failure value (usually an exception). So it should be fine to have `isUVPAA()` return a rejected promise containing an exception. One could argue that this would be a breaking API change since the current description of the function reads:

>Upon invocation, the client employs a client platform-specific procedure to discover available user-verifying platform authenticators. If any are discovered, the promise is resolved with the value of `true`. Otherwise, the promise is resolved with the value of `false`.

...so as written it seems to indicate it will never fail. But one could also argue that this is not a breaking change since there always was the theoretical possibility that it would return a rejected promise.

-- 
GitHub Notification of comment by emlun
Please view or discuss this issue at https://github.com/w3c/webauthn/pull/1214#issuecomment-491299616 using your GitHub account

Received on Friday, 10 May 2019 14:01:32 UTC