Make errors a way forward
A failure should say what happened and what a caller can safely do next.
Is Agenticis-agentic.com
The score is an at-a-glance summary; the individual checks and evidence are the useful part of the report.
Notes from the Is Agentic checks and report format.
Fail in a useful shape
Choose a failure and read what the client can do next.
Dead endBad
{ error: "Something went wrong" }Recovery contractGood
application/problem+jsonreturn Response.json({
type: 'https://example.com/problems/report-not-found',
title: 'Report not found',
status: 404,
code: 'report_not_found',
detail: 'No completed report is stored for this URL.',
resolution: 'Start the linked scan, then retry.',
}, {
status: 404,
headers: { 'Content-Type': 'application/problem+json' },
});
Why it matters, pros and cons
Why it matters
A vague error turns recovery into guesswork. Stable codes and plain next steps let callers recover without scraping copy.
Pros
- Agents can branch on the code.
- People can understand the detail.
- Retry behavior becomes explicit.
Cons
- Do not leak private state through errors.
- Codes become an API you must maintain.
- A recovery hint must be safe, not merely possible.