Rocket/contrib/sync_db_pools/lib/src
Sergio Benitez 186ec84f5b 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-11-01 18:50:58 -05:00
..
config.rs Split 'rocket_contrib' into distinct crates. 2021-05-24 22:57:51 -07:00
connection.rs Improve forwarding status code precision. 2023-11-01 18:50:58 -05:00
error.rs Split 'rocket_contrib' into distinct crates. 2021-05-24 22:57:51 -07:00
lib.rs New version: 0.5.0-rc.3. 2023-03-23 16:56:17 -07:00
poolable.rs Add support for 'diesel-async' to 'db_pools'. 2023-10-26 19:46:35 -05:00