Borrowing it
Nothing to install: this file belongs to bredmond1019/claude-sdk-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/bredmond1019/claude-sdk-rs/main/.claude/commands/test_error_handling.mdgit clone --depth 1 https://github.com/bredmond1019/claude-sdk-rsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_error_handling)<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_error_handling"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/test_error_handling/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_error_handling"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/test_error_handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00893 |
| Opus 5.5 | $0.00000 | $0.00357 |
| Sonnet 5.5 | $0.00000 | $0.00179 |
| Haiku 4.5 | $0.00000 | $0.00089 |
Grade A, and why
test_error_handling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.
E2E Template — Error Handling
Test that the UI and API surface errors correctly and do not expose raw internals. Replace all
{{PLACEHOLDER}} tokens before running.
Principle
For every error path, assert two things:
- The right HTTP status / UI state is returned.
- No raw stack trace, internal path, or unmasked secret leaks to the client.
API Error Tests
1. Validation error (400 / 422)
Trigger: send a request with a missing or malformed required field.
POST {{BASE_URL}}/{{ENDPOINT}}
Content-Type: application/json
{ "{{FIELD_NAME}}": null }
Assert:
- Status:
400or422. - Body contains a human-readable
detail/message/errorsfield. - Body does NOT contain a Python traceback, SQL query, or file path.
- Body does NOT echo back internal variable names.
2. Server error (500)
Trigger: call an endpoint designed to fail (or mock via test setup / network intercept).
GET {{BASE_URL}}/{{ERROR_TRIGGER_ENDPOINT}}
Assert:
- Status:
500 Internal Server Error. - Body is a generic error message (e.g.
{"detail": "Internal server error"}). - Body does NOT contain a stack trace.
- Body does NOT contain file system paths.
- Response time <
{{TIMEOUT_MS}}ms (server didn't hang).
3. Network timeout
Trigger: configure the client to use a very short timeout (e.g. 50 ms), or use a mock server with a delayed response.
Assert (client-side / UI):
- The UI shows a user-visible error (e.g. "Request timed out. Please try again.").
- The UI does not hang indefinitely.
- The UI does not show a raw
ECONNRESETorTimeoutErrorstack trace.
UI Error Tests
4. Form validation — user-visible error message
Trigger: submit a form with an invalid or missing field (see test_ui_form.md step 2).
Assert:
- An error message is visible near the invalid field.
- The error is in plain language (not a code reference like
ValidationError at line 42). - The page does not crash (no blank white screen, no unhandled promise rejection banner).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 126 lines · 0 tokens per session scan A 6a35c2fc64ee
test_error_handling is a command published in the GitHub repository bredmond1019/claude-sdk-rs (23 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 893 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-26.
test_error_handling compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| test_error_handlingbredmond1019/claude-sdk-rs | Command | 23 | 1mo ago | Apache-2.0 | A | 0 | Claude Code |
| playwright-test-healmicrosoft/playwright | Command | 99k | yesterday | Apache-2.0 | A | 2 | GitHub Copilot |
| webapp-testinghamr0/agentic-toolkit | Command | 23 | 6d ago | Apache-2.0 | A | 35 | Claude Code |
| verify-prdesplega-ai/qa-use | Command | 29 | 1mo ago | MIT | A | 0 | Claude Code |
| ui-snapshot.templateevan043/claude-cli-advanced-starter-pack | Command | 61 | 3mo ago | MIT | A | 0 | Claude Code |
| test-rundesplega-ai/qa-use | Command | 29 | 1mo ago | MIT | A | 0 | Claude Code |
| laravel-playwrightjpcaparas/superpowers-laravel | Command | 157 | 4mo ago | MIT | A | 20 | Claude Code |