W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2014

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

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Wed, 8 Oct 2014 16:18:45 +0000
To: Anne van Kesteren <annevk@annevk.nl>
Message-ID: <2fb72fc0b9024c0a9065e7b303374072@BN1PR05MB325.namprd05.prod.outlook.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Andrew Wilson <atwilson@google.com>, WHATWG List <whatwg@whatwg.org>, Jake Archibald <jaffathecake@gmail.com>, Peter Beverloo <beverloo@google.com>, Jonas Sicking <jonas@sicking.cc>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:24 UTC