You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on my previous programming experience, it's common that I define a set of error codes and errors are constructed with a code with a detailed message.
It seems Zig provides error set enums to fit the error code part, while I don't know how to return errors with messages. Or it's Zig's best practice to representing errors fully by codes.
A real-world example is that - when I'm parsing a specific config file, I'd like to distinguish parsing errors and IO errors, but what exactly the parsing error is is not significant. While I still need to tell the caller about the details of the parsing error, the control flow is the same for all of them.