News for hackers. Stuff that matters.
Re:Go’ing Insane: Endless Error Handling by ccakes on Tuesday September 14, 2021 @07:47AM (#28523252)
The operator is just syntax sugar for something roughly this

    let foo = foo()?;

    // Expanded
    let foo = match foo() {
      Ok(v) => v,
      Err(e) => return Err(From::from(e))
    };
If you're using your own error type then you can impl From/Into yourself to capture additional context from the source error (or a stacktrace) in addition to using map_err() as others have suggested

There are no comments on this comment yet.