News for hackers. Stuff that matters.
Re:Rustaceans at the border by bobbylarrybobby on Friday April 15, 2022 @05:04PM (#31045814)
The lack of context is a pain. For instance, trying to open a file that doesn't exist just gives the error "file not found" without telling you the path you tried to open.
Re:Rustaceans at the border by ragnese on Monday April 18, 2022 @08:09AM (#31069622)
Fair enough. But that doesn't have to do with the error handling mechanism of Rust, nor would any of these error helper libraries fix that. It's just a criticism of the error type that's actually returned. A Java-style exception can be written that's just as lacking. No language that I'm aware of will automatically include function arguments in its errors/exceptions- it's up to the author of the error/exception type to include that info.
Re:Rustaceans at the border by kaba0 on Saturday April 16, 2022 @02:46AM (#31050165)
You can just map the error to a tuple for example with the file name.