Re:Rustaceans at the border
by jupp0r on Friday April 15, 2022 @10:55AM
(#31040941)
Async error handling has been a nightmare last time I tried a few months ago. Has that improved lately?
[ Parent
| on HN ]
Re:Rustaceans at the border
by lijogdfljk on Friday April 15, 2022 @11:23AM
(#31041231)
Pardon my ignorance, but what do you mean? Handling errors with the async runtime..?
If you just mean handling errors from funcs .. it's no different than non-async, no?
Yes, if all error types from various libraries are `Send` + `Sync` it's easy, if not, you are running into issues where you need to wrap them in reference counted containers because some of them aren't copyable either. Crates like failure, thiserror and anyhow didn't simplify this (although I really like their general approach to wrapping low level errors in high level errors with a breadcrumb trail to details).