anthropics / anthropics/claude-code-action

Unhelpful error message when API key has no credits

Offen
#874 5 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug dev-experience p2 provider:1p
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

## Description

When the `anthropic_api_key` is valid but has no credits, the action fails with an unhelpful error:

```
{
"type": "result",
"subtype": "success",
"is_error": true,
"duration_ms": 139,
"num_turns": 1,
"total_cost_usd": 0,
"permission_denials": []
}
SDK execution error: 14 | depsCount: ${Q},
15 | deps: ${$}}`};var Pj={keyword:"dependencies"...
[minified JavaScript continues]

error: Claude Code process exited with code 1
```

## Expected behavior

A clear error message like:
- "API key has no credits. Add credits at https://console.anthropic.com/settings/billing"
- "Authentication failed: insufficient credits"

## Actual behavior

- Exit code 1 with no meaningful error
- Minified JavaScript stack trace
- `total_cost_usd: 0` and `duration_ms: 139` (fails before API call)

## Impact

Spent significant debugging time before realizing the API key simply had no credits. The error gives no indication of the actual problem.

## Environment

- Action version: `anthropics/claude-code-action@v1`
- Trigger: `issue_comment`

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.