D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22947 - sysErrorString throws Exception instead of WindowsException
Summary: sysErrorString throws Exception instead of WindowsException
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Windows
: P1 minor
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2022-03-27 18:39 UTC by moonlightsentinel
Modified: 2022-03-31 08:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2022-03-27 18:39:09 UTC
This contradicts the documentation of WindowsException which is intended for errors based of GetLastError.
Comment 1 Dlang Bot 2022-03-27 22:23:24 UTC
@MoonlightSentinel created dlang/phobos pull request #8422 "Fix 22947 - Use wenforce in sysErrorString" fixing this issue:

- Fix 22947 - Use wenforce in sysErrorString
  
  This ensures that the method throws a `WindowsException` initialised
  with the proper error code. Also avoids unrelated exceptions that
  could suppress the error which caused the call to `sysErrorString`.

https://github.com/dlang/phobos/pull/8422
Comment 2 Dlang Bot 2022-03-31 08:24:57 UTC
dlang/phobos pull request #8422 "Fix 22947 - Use wenforce in sysErrorString" was merged into master:

- 5c60f05dc94be988f69d3e7b025205cf657f80b1 by MoonlightSentinel:
  Fix 22947 - Use wenforce in sysErrorString
  
  This ensures that the method throws a `WindowsException` initialised
  with the proper error code. Also avoids unrelated exceptions that
  could suppress the error which caused the call to `sysErrorString`.

https://github.com/dlang/phobos/pull/8422