Rocket: one `IntoOutcome` for `Result` implementation returns a `BadRequest`, the other `InternalServerError`

Created on 3 Jan 2017  路  2Comments  路  Source: SergioBenitez/Rocket

from_data.rs has Err(err) => Failure((Status::InternalServerError, err)) and from_request.rs has Err(val) => Failure((Status::BadRequest, val)).

accepted enhancement

Most helpful comment

This is by design, though a rather arbitrary one. IntoOutcome is not a particularly great trait at the moment. I believe the API should be:

result.into_outcome(failing_status)

This will remove the current arbitrary nature while adding flexibility.

All 2 comments

This is by design, though a rather arbitrary one. IntoOutcome is not a particularly great trait at the moment. I believe the API should be:

result.into_outcome(failing_status)

This will remove the current arbitrary nature while adding flexibility.

Putting this in the 0.4 bucket for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hokutosei picture Hokutosei  路  4Comments

incker picture incker  路  3Comments

ndarilek picture ndarilek  路  3Comments

lambda-fairy picture lambda-fairy  路  4Comments

denysvitali picture denysvitali  路  3Comments