Rocket/examples/serialization/src
Sergio Benitez fbd1a0d069 Improve forwarding status code precision.
Previously, the `NotFound` status code was used to signal many kinds of
recoverable, forwarding errors. This included validation errors, incorrect
Content-Type errors, and more.

This commit modifies the status code used to forward in these instances to more
precisely indicate the forwarding condition. In particular:

  * Parameter `FromParam` errors now forward as 422 (`UnprocessableEntity`).
  * Query paramater errors now forward as 422 (`UnprocessableEntity`).
  * Use of incorrect form content-type forwards as 413 (`UnsupportedMediaType`).
  * `WebSocket` guard now forwards as 400 (`BadRequest`).
  * `&Host`, `&Accept`, `&ContentType`, `IpAddr`, and `SocketAddr` all forward
    with a 500 (`InternalServerError`).

Additionally, the `IntoOutcome` trait was overhauled to support functionality
previously offered by methods on `Outcome`. The `Outcome::forward()` method now
requires a status code to use for the forwarding outcome.

Finally, logging of `Outcome`s now includes the relevant status code.

Resolves #2626.
2023-10-31 18:44:37 -05:00
..
json.rs Fix various generated and direct clippy warnings. 2021-06-08 13:27:09 -07:00
main.rs Graduate contrib 'uuid' into core. 2021-05-22 11:01:00 -07:00
msgpack.rs Fix various generated and direct clippy warnings. 2021-06-08 13:27:09 -07:00
tests.rs Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
uuid.rs Fix various generated and direct clippy warnings. 2021-06-08 13:27:09 -07:00