๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
- Mastodon: @nrc
- Twitter: @nick_r_cameron
- Blog: ncameron.org/blog
- Website: ncameron.org
- Pronouns: he/him
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
Documentation of Rust error handling
License: Creative Commons Attribution 4.0 International
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
The larger the scope of code handled by an error handler, the more fragile that code is
I haven't used it myself so I can't really say anything about the viability, but wanted to let it here nevertheless.
https://crates.io/crates/error-stack
Some explanatory comment on reddit:
https://www.reddit.com/r/rust/comments/vpg49v/comment/ieppvjv/?context=3
I want to add some case studies to the error design section. Ideas:
Talk about failpoints (and alternatives) in the testing section. Probably should reference the fail crate (https://docs.rs/fail/latest/fail/). I'm not actually sure failpoints are always the best solution, so this should be a discussion rather than a recommendation, but they are sometimes useful and are definitely doing something which is necessary
I might be worth to more clear point out that UnwindSafe
is misleading, in that it is unrelated to unsafe
/rust safety guarantees.
I.e. your type must be rust-safe to reuse after a catch_unwind
no matter weather it implements UnwindSafe
or not. If it's not it is unsound. Something which is often missed.
UnwindSafe
is more like a marker indicating that something plays well with unwinding, instead of it being "rust-safe" wrt. unwinding.
To make things worse it is relatively easy to have code which doesn't play well with unwinding, but does accidentally implement UnwindSafe
due *mut T
being UnwindSafe
if T: RefUnwindSafe
... (it is that way due to *mut T
often being an owning pointer, but if it's used for a &mut T
-like thing you have to explicitly remember to disable it's UnwindSafe
implementation).
I'm using this issue to collect feedback from various places after initial publication
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.