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

I don't think we need to distinguish between not fully-active and not visible. `InvalidStateError` seems reasonable for both, though the current `NotAllowedError` also seems reasonable. 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. The two situations I can imagine are transient failures (not fully-active and not visible) and permanent errors (permissions policy failure). Using `InvalidStateError` for transient failures and `NotAllowedError` for permanent ones seems like a reasonably clear distinction. A developer could try again in the former case while giving up and taking a different approach in the latter.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 29 September 2022 22:59:29 UTC