-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Zig Version
0.10.0-dev.37+3bd0575cf
Steps to Reproduce
When using GetQueuedCompletionStatus to process async network requests on Windows, cause a common error like disconnecting the peer. In this case, the function immediately panics with this error:
thread 20816 panic: unexpected error: Win32Error.NETNAME_DELETED
In a release build, this error is ignored entirely.
Reference: GetQueuedCompletionStatus.
Expected Behavior
GetQueuedCompletionStatus should return an error in all failure cases instead of panicking in debug builds, and doing nothing in release builds. The current behavior means that, when using this function, there's no way to detect that a certain error happened and then to handle it in an application-specific way.
Actual Behavior
GetQueuedCompletionStatus panics in all but a few cases in debug builds.
Example panic message:
thread 20816 panic: unexpected error: Win32Error.NETNAME_DELETED