Failing in a shape callers can readintermediate
A raw exception string tells the caller nothing they can act on; RFC 7807 ProblemDetails gives every failure the same machine-readable shape.
POST /orders trusts whatever JSON arrives: a body with items: "rice" is stored, and a client can set its own id and status. Validate at the door — the body is unknown until a guard proves otherwise.
Valid bodies are created with a Location, invalid ones are 400s naming the field, client ids and statuses are ignored, and the body is never cast.
Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.
A raw exception string tells the caller nothing they can act on; RFC 7807 ProblemDetails gives every failure the same machine-readable shape.
A type is a note to your future self that the compiler checks — annotating what goes in and what comes out is where most of the value is, before any advanced feature.