The error could contain the origin of the error for easier debugging. That way it is possible to debug bottom up by inserting debug info in the function that throws the error to find out which call delivered the faulty info. A full call stack log would make this even easier.
use crate::Error;
use rocket::http::uri::Origin;
pub fn does_user_exist(origin: &Origin) -> Result<User, Error> {
match user_exists {
false => Err(Error::user_missing(origin.path())),
true => Ok(user),
}