|
|
|
|
|
by oconnor663
1512 days ago
|
|
> Exceptions gives us a nice way to let problems bubble up to the surface, while also stating what the problem was, and where it occurred. Work is ongoing on some of this, but there are popular libraries in Rust (like `anyhow`) that let you attach backtraces to regular errors, add context, etc. Propagating erros to callers is handled with the standard `?` operator, which means "short-circuit and return this if it was an error, otherwise give me the successful result". This has the benefit of making early exits explicit, without interrupting the visual flow of straight-line code. |
|