Preserve platform error codes. #2389
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
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.
The text was updated successfully, but these errors were encountered: