classifyError (workflow-error-classify.ts)

ClawRecipes · payments, error-classification, workflow-automation, automation

1": "1" units": "0"0"1" Verbs"> "Source" 1" units": "0"1" output should "trunct " one sentence.":

// Source: https://github.com/JIGGAI/ClawRecipes | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { ToolsInvokeError } from '../../toolsInvoke.js';

export type ErrorCategory = 'funding' | 'rate-limit' | 'auth' | 'timeout' | 'unknown';

const FUNDING_PATTERNS = [
  /insufficient.*(credits?|funds?|balance)/i,
  /billing/i,
  /payment\s+required/i,
  /quota\s+exceeded/i,
  /out\s+of\s+credits/i,
  /budget\s+(exceeded|limit)/i,
  /no\s+(active\s+)?subscription/i,
  /plan\s+(limit|exceeded)/i,
];

const RATE_LIMIT_PATTERNS = [
  /rate\s+limit/i,
  /too\s+many\s+requests/i,
  /throttl/i,
];

const AUTH_PATTERNS = [
  /unauthorized/i,
  /invalid.*api.?key/i,
  /forbidden/i,
  /aut

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key