Closed Tronikelis closed 1 year ago
Hey, the docs define a status property which does not exist in the latest version 1.3.1, did not check older
1.3.1
Docs:
#[middleware_fn] async fn error(mut context: Ctx, _next: MiddlewareNext<Ctx>) -> MiddlewareResult<Ctx> { let res = "Hello, world".parse::<u32>(); let non_existent_param = map_try!(res, Err(_) => { Error { context, message: "Parsing failure!".to_string(), status: 400 // <- here ! } } ); context.body(&format!("{}", non_existent_param)); Ok(context) }
status does not exist in the struct:
https://github.com/thruster-rs/Thruster/blob/2a454e1958687aa67946781251fa70c49f029cf3/thruster/src/core/errors.rs#L4-L8
Ah, good call, it was redundant and confusing because it really should be set on the context object instead. I'll update the docs accordingly.
Thank you!
Hey, the docs define a status property which does not exist in the latest version
1.3.1
, did not check olderDocs:
status does not exist in the struct:
https://github.com/thruster-rs/Thruster/blob/2a454e1958687aa67946781251fa70c49f029cf3/thruster/src/core/errors.rs#L4-L8