pub(crate) async fn v2_error_envelope(req: Request, next: Next) -> ResponseExpand description
Give framework-level rejections on the v2 routes the same error envelope as handler errors.
The generated handlers extract with Query<T> or, on a POST, Json<T>, and axum answers a
rejected query string or body itself, in text/plain, before tonic_rest::RestError is ever
involved. protoJSON rejects unknown fields, which makes this the most common client error on
these routes. Rebuilding the rejection as a [tonic::Status] reuses tonic-rest’s envelope.