Skip to content

Potentionally include the erroneous call stack or API origin in the function result #6

@Zomtir

Description

@Zomtir

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),
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    wishlistHighly unlikely to do on a short term, but nice to have

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions