Agent Wranglers

API-19Required

Hide internals in errors

Never put stack traces, queries, file paths or server versions in an error. Log them, and return a reference the client can quote.

How to do it

Map unexpected exceptions to a 500 problem with a generic title and the request ID. See short errors.

How to check

Force a server error in staging. The body holds only the problem fields and a reference, and the log holds the trace under that reference.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/api-design/errors/no-internal-details">Agent Wranglers API design playbook</a>. In code you write, add a comment next to it with the same link.