MCPcopy
hub / github.com/BlockRunAI/ClawRouter / recordProviderError

Function recordProviderError

src/proxy.ts:479–492  ·  view source on GitHub ↗

Record an error category hit for a model.

(modelId: string, category: ErrorCategory)

Source from the content-addressed store, hash-verified

477
478/** Record an error category hit for a model. */
479function recordProviderError(modelId: string, category: ErrorCategory): void {
480 if (!perProviderErrors.has(modelId)) {
481 perProviderErrors.set(modelId, {
482 auth_failure: 0,
483 quota_exceeded: 0,
484 rate_limited: 0,
485 overloaded: 0,
486 server_error: 0,
487 payment_error: 0,
488 config_error: 0,
489 });
490 }
491 perProviderErrors.get(modelId)![category]++;
492}
493
494/**
495 * Check if a model is currently rate-limited (in cooldown period).

Callers 1

proxyRequestFunction · 0.85

Calls 2

setMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected