diff --git a/core/lib/src/form/context.rs b/core/lib/src/form/context.rs index f43e0485..a2e2ca35 100644 --- a/core/lib/src/form/context.rs +++ b/core/lib/src/form/context.rs @@ -299,19 +299,57 @@ impl<'v> Context<'v> { self.status } - pub(crate) fn push_error(&mut self, e: Error<'v>) { - self.status = std::cmp::max(self.status, e.status()); - match e.name { + /// Inject a single error `error` into the context. + /// + /// # Example + /// + /// ```rust + /// # use rocket::post; + /// # type T = String; + /// use rocket::http::Status; + /// use rocket::form::{Form, Contextual, Error}; + /// + /// #[post("/submit", data = "