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.
404, 401, 409 and the shape of the error body. The half of the API that only shows up in production.
Three failure paths asserted by exact status code, and the error body checked as ProblemDetails.
Published in full, before you start — every point is one of these and there is nothing else.
A raw exception string tells the caller nothing they can act on; RFC 7807 ProblemDetails gives every failure the same machine-readable shape.
Authentication is who you are; authorization is what you are allowed to do. Policies keep that rule in one place instead of scattered if-statements.