Errors clients can act on

Back to list2026-06-29
You

What should an API error body contain?

ChatGPT

A stable machine-readable code, a human sentence, and, when the fault is the client's, which field. Stack traces help nobody outside your team, and a bare 400 turns every integration into guesswork.

You

Path versioning or headers?

ChatGPT

Path versioning, for a small team. It is visible in logs, cacheable, and trivially explained. Header negotiation is more elegant and is the version people get wrong in curl, in caches and in the one client that matters.

You

Offset pagination skips rows when new ones arrive.

ChatGPT

Use a keyset: order by a stable column plus the primary key, and pass the last seen values as the cursor. Offsets are computed against a moving table, which is precisely why rows appear twice or vanish.