News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by lkirkwood on Tuesday November 26, 2024 @03:35AM (#42243676)
I felt the same but after switching to anyhow and thiserror in pretty much every Rust project I work on I find it quite painless. It's not ideal to rely on crates for a core language feature but I never find myself fighting error types anymore. Have you tried those crates? Do you still hold that opinion?
Re:Lies we tell ourselves to keep using Golang by masklinn on Tuesday November 26, 2024 @04:28AM (#42243993)
You don’t need crates for it, anyhow is basically a better Box<dyn Error>, if you just want the error signal you can use that. The main thing missing from the stdlib fur this use case is I don’t think there’s anything to easily wrap / contextualise errors built in.