[Issue 13541] std.windows.syserror.sysErrorString() should be nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 28 00:20:18 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=13541

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8420 "Fix 13541 - Replace plain usages of
sysErrorString for errors" was merged into master:

- 304160f5af979e56b667440520915fede5bfdd4d by MoonlightSentinel:
  Issue 13541 - Use `wenforce` instead of `enforce` + `sysErrorString`

  This ensures that the actual error message won't be suppressed when the
  lookup error code => message fails. The exception will also be more
  informative because `WindowsException` is explicitly intended for
  Windows API errors.

- 362e81830c2cab9ed1508330d9886c0f4e1ebc12 by MoonlightSentinel:
  Fix 13541 - Replace usages of sysErrorString` with a helper function

  `sysErrorString` throws an exception for unknown error codes (e.g. from
  libraries using `SetLastError`) and hence could hide the actual error
  that caused the call to `sysErrorString`.

  The new helper function wraps the error code lookup and returns `Error X`
  on failure.

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

--


More information about the Digitalmars-d-bugs mailing list