diff --git a/core/lib/src/response/responder.rs b/core/lib/src/response/responder.rs index 5e6937e5..1e33d4de 100644 --- a/core/lib/src/response/responder.rs +++ b/core/lib/src/response/responder.rs @@ -271,10 +271,17 @@ impl<'r, R: Responder<'r>> Responder<'r> for Option { /// If `self` is `Ok`, responds with the wrapped `Responder`. Otherwise prints /// an error message with the `Err` value returns an `Err` of /// `Status::InternalServerError`. +#[deprecated(since = "0.4.3")] impl<'r, R: Responder<'r>, E: fmt::Debug> Responder<'r> for Result { default fn respond_to(self, req: &Request) -> response::Result<'r> { self.map(|r| r.respond_to(req)).unwrap_or_else(|e| { error_!("Response was a non-`Responder` `Err`: {:?}.", e); + warn_!("This `Responder` implementation has been deprecated."); + warn_!( + "In Rocket v0.5, `Result` implements `Responder` only if \ + `E` implements `Responder`. For the previous behavior, use \ + `Result>` where `Debug` is `rocket::response::Debug`." + ); Err(Status::InternalServerError) }) }