Forge Error Classification Utility (forge/errors.go)

clawbench · internal/forge/errors.go · go · MIT
auth, infra, integration, lang:go, tag:error-handling

Provides standardized error types and classification for external platform integrations. Use this to handle API failures, rate limits, and authentication errors consistently.

// Source: https://github.com/clawbench-dev/clawbench | License: MIT | Copyright 2025 xulongzhe
// Provided via justclaw.it.com; keep this notice with the code.
package forge

import (
	"errors"
	"fmt"
)

// ErrorKind classifies a forge error so callers (UI, poller) can react
// appropriately — e.g. "go fix your token" vs "wait and retry".
type ErrorKind string

const (
	// ErrKindAuth means the credential is missing, invalid, expired or lacks
	// scope. The user must act.
	ErrKindAuth ErrorKind = "auth"
	// ErrKindRateLimit means the platform throttled the request. Retry later.
	ErrKindRateLimit ErrorKind = "rate_limit"
	// ErrKindNotFound means the item/repo does not exist or is not visible to
	// the credential.
	ErrKindNotFound ErrorKind = "not_found"
	// ErrKindNetwork means a transpo

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

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

Get a free API key