Thread overview | ||||||
---|---|---|---|---|---|---|
|
February 03, 2013 shell doesn't throw on error. Is that a regression? | ||||
---|---|---|---|---|
| ||||
The doc for std.process.shell says "If the process could not be started or exits with an error code, throws an exception." However on OSX I'm having a different kind of behavior. Isn't there a unittest to test this? --- import std.process; import std.stdio; void main(){ shell("asfasfasdfasdf"); writeln("ok"); } --- prints: in dmd.2.061 - 2.059: sh: asfasfasdfasdf: command not found ok in dmd.2.057: sh: asfasfasdfasdf: command not found std.exception.ErrnoException@std/stdio.d(418): Could not close pipe `asfasfasdfasdf' (Undefined error: 0) |
February 03, 2013 Re: shell doesn't throw on error. Is that a regression? | ||||
---|---|---|---|---|
| ||||
Posted in reply to timotheecour | On 2/3/13, timotheecour <thelastmammoth@gmail.com> wrote: > Isn't there a unittest to test this? The only unittest is unfortunately pretty bad: unittest { auto x = shell("echo wyda"); } Please feel free to file a bug: http://d.puremagic.com/issues/enter_bug.cgi?product=D |
February 03, 2013 Re: shell doesn't throw on error. Is that a regression? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | here goes: http://d.puremagic.com/issues/show_bug.cgi?id=9444 please see my added comment in 9444 regarding capturing std err instead of displaying it. |
February 03, 2013 Re: shell doesn't throw on error. Is that a regression? | ||||
---|---|---|---|---|
| ||||
Posted in reply to timotheecour | On Sunday, 3 February 2013 at 02:28:26 UTC, timotheecour wrote: > here goes: > http://d.puremagic.com/issues/show_bug.cgi?id=9444 > > please see my added comment in 9444 regarding capturing std err instead of displaying it. actually the new std.process pull request (http://forum.dlang.org/thread/k5uprq$obu$1@digitalmars.com) works well. I wonder when that'll get in master? |
Copyright © 1999-2021 by the D Language Foundation