Skip to content
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

Preserve platform error codes. #2389

Closed
shawnl opened this issue Apr 30, 2019 · 1 comment
Closed

Preserve platform error codes. #2389

shawnl opened this issue Apr 30, 2019 · 1 comment
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@shawnl
Copy link
Contributor

shawnl commented Apr 30, 2019

Extracted from #1396 (comment)_

Now that #2380 has been accepted, we should work to preserve the native error values. They are not a bad idea (as long as you don't use errno), and are important for debugging.

We have no control over these error codes. During the life-time of a Zig binary they may change, and a Zig binary must not act unpredictably when they do, nor should that binary obscure what the error was when it happens.

Because of this we should reserve the negative values of the internal error union for system errors (on applicable platforms). We would still have zig-style names for them (and those names, but not values, could be unified as much as possible between platforms), but those names would be mapped to the system values.

@andrewrk andrewrk added this to the 0.6.0 milestone May 1, 2019
@andrewrk andrewrk added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label May 1, 2019
@andrewrk andrewrk added the standard library This issue involves writing Zig code for the standard library. label Jan 5, 2020
@andrewrk
Copy link
Member

andrewrk commented Jan 5, 2020

I am not convinced of the use case.

@andrewrk andrewrk closed this as completed Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

2 participants