News for hackers. Stuff that matters.
Re:Go’ing Insane: Endless Error Handling by masklinn on Tuesday September 14, 2021 @09:15AM (#28524286)
> I haven’t used Rust. Does the ? operator add some kind of stack trace to the error?

No. `?` performs an optional conversion and an early return, that’s it (kinda).

> If not, how do you know where the error has come from?

By default you don’t. There are utility libraries you can use to attach such information to error types (and eventually the stdlib will provide one), but OOTB an error value is… quite literally anything (it should probably implement `Error` but doesn’t actually have to).

This is in keeping with the idea that hidden costs should be avoided when possible, and that reified results should be the norm so should have as little requirement as possible.

There are no comments on this comment yet.