Bug 18229 – Misleading documentation of std.process.environment.get
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-01-12T09:51:12Z
Last change time
2018-02-07T03:07:43Z
Keywords
ddoc, pull
Assigned to
No Owner
Creator
Tomáš Chaloupka
Comments
Comment #0 by chalucha — 2018-01-12T09:51:12Z
It is stated: Unlike $(LREF environment.opIndex), this function never throws.
Here: https://github.com/dlang/phobos/blob/master/std/process.d#L3344
But the method is not nothrow and there is also:
Throws:
$(REF UTFException, std,utf) if the variable contains invalid UTF-16
characters (Windows only).
I'm not sure if at least for POSIX this can be marked as a nothrow or just change the documentation.
Comment #1 by schveiguy — 2018-01-17T01:33:49Z
Hm... I think it means it doesn't throw when the variable doesn't exist (as opIndex does). But it does throw if the name being searched for is invalid.
Definitely I think this is a doc issue.