[whatwg/webidl] Bikeshedding help needed for generic over-limit error (Issue #1463)

### What is the issue with the Web IDL Standard?

In https://github.com/webmachinelearning/writing-assistance-apis/pull/31 I proposed adding a `TooManyTokens` [`DOMException`-derived interface](https://webidl.spec.whatwg.org/#idl-DOMException-derived-interfaces) which gives information on how far over the token limit you are. It had properties `tokenCount` and `tokensAvailable`, such that `ex.tokenCount > ex.tokenAvailable` is the error condition being signaled.

@michaelwasserman pointed out that this would probably be worth generalizing beyond "tokens", for the entire web ecosystem to use. I tend to agree. I'm just unsure what the general names should be.

My current best proposal is: `QuotaExceededDetailedError`, with properties `quota` and `request`. This plays off of the existing, non-detailed `"QuotaExceededError"` `DOMException`.

Other options:

- `LimitExceededError`, `LimitError`, `OverageError`
- `requested` (instead of `request`), `limit`, `max`, `available`
- `amount`, `value`, `attempted`

Does the community have any thoughts on what would be the best names, which are suitable for the web API ecosystem as a whole?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1463
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1463@github.com>

Received on Friday, 24 January 2025 03:05:45 UTC