Search Results
7/3/2025, 4:59:22 PM
>>105789132
yes, error boilerplate can be annoying. I have heard of anyhow, but have not tried it, nor do I have an interest in trying it.
the crux of the issue with error management is assigning identifiers to each failable code path within your codebase.
I give each function that can return an error its own error enum (identifies the function that failed). I give each failed code path its own member in the enum (identifies the path that failed). `#[from]` is used liberally to link to downstream errors.
tl;dr: error handling in general is a bitch (if you care about being able to determine what exactly went wrong). I think spending the time writing the boilerplate initially is worth it, because it prevents me from needing to go back to old code and update its error handling shenanigans when I find that I actually am interested in figuring out what exactly went wrong.
yes, error boilerplate can be annoying. I have heard of anyhow, but have not tried it, nor do I have an interest in trying it.
the crux of the issue with error management is assigning identifiers to each failable code path within your codebase.
I give each function that can return an error its own error enum (identifies the function that failed). I give each failed code path its own member in the enum (identifies the path that failed). `#[from]` is used liberally to link to downstream errors.
tl;dr: error handling in general is a bitch (if you care about being able to determine what exactly went wrong). I think spending the time writing the boilerplate initially is worth it, because it prevents me from needing to go back to old code and update its error handling shenanigans when I find that I actually am interested in figuring out what exactly went wrong.
Page 1