Re: [whatwg] Notifications: making requestPermission() return a promise

From: annevankesteren@gmail.com [mailto:annevankesteren@gmail.com] On Behalf Of Anne van Kesteren

> I don't think you should need try/catch for a common failure case.

Ah, this is the crux of our minor-disagreement, I think.

IMO using try/catch for a common failure case is fine, *as long as you want that failure to bubble up the call stack*. E.g., if you want to handle it at a higher level along with other failures, or if you want to ignore the possibility of failure except in how errors get sent to `window.onerror`.

Now, I think we're likely in *agreement* that you don't actually want to do this for requestPermission---you should handle it as soon as possible. But our reasoning is different, and now I understand why.

Received on Wednesday, 8 October 2014 16:19:19 UTC