New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to return error with message or there is a better way? #15892
Comments
The relevant issue is #2647 These types of questions should be directed at one of the community spaces instead. |
Thank you @squeek502! I know and would love to ask in an active channel instead of the issue tracker. But see the "OT" comment at #15788 (comment) that I don't find any of the channel active. |
Note that the Discord link has been fixed since that comment (#15759). |
Thank you. Let me try it again. Closed this one as duplicated. |
Emmm...seems still not work. I may expect a low bar platform distinguish from the issue tracker said a GH Discussions forum or I don't know if https://ziggit.dev/ is active (seems no too much traffics and replies). Sorry that as a user I will try to find the most active channel to ask questions where I can get response most responsively. |
Discord is the most active, not sure why the invite link is not working for you. The https://discord.gg/zig link seems to be correct AFAICT. IRC is also active but responses may be slower. |
I get it work now, both Discord and IRC. Thank you! |
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.
The text was updated successfully, but these errors were encountered: