W3C home > Mailing lists > Public > public-device-apis-log@w3.org > October 2022

Re: [screen-wake-lock] Distinguish exceptions on .request() (#352)

From: Reilly Grant via GitHub <sysbot+gh@w3.org>
Date: Tue, 04 Oct 2022 00:24:58 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-1266241977-1664843097-sysbot+gh@w3.org>
> > The question I ask myself when thinking about this sort of thing is whether there is a different action the developer would take depending on the error.
> I'm approaching it more from "why did it fail?" instead of what action can one take (i.e., taking some of the guess work out of it, otherwise it could have failed for any reason in the spec).

That's what the message is for. If we are explaining the error to the developer then we have as many words as we want to do that. What I want to avoid is developers running regular expressions over the message string to figure out what step to take next. That's where having well-considered use of the DOMException types is important.

GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/screen-wake-lock/issues/352#issuecomment-1266241977 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 4 October 2022 00:25:00 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 4 October 2022 00:25:00 UTC