refactor(api): move the server CDM licence cap into one module that measures tracks by the -q rule

This commit is contained in:
imSp4rky
2026-11-29 09:16:18 -07:00
parent 6fc2d84bd7
commit 8e67081e11
13 changed files with 318 additions and 168 deletions
+5
View File
@@ -77,6 +77,11 @@ class APIErrorCode(str, Enum):
E = TypeVar("E", bound=BaseException)
def cap_note(cap: int) -> str:
"""The sentence that names a ``server_cdm_max_height`` cap, on the server and on the client."""
return f"The server CDM licenses up to {cap}p for this API key"
def coded(exc: E, code: APIErrorCode) -> E:
"""``exc`` with the API error code that ``categorize_exception`` reports for it, whatever its message says."""
exc.error_code = code # type: ignore[attr-defined]