[Issue 16502] spawnProcess does not throw on exec errors
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Dec 27 10:03:14 PST 2016
https://issues.dlang.org/show_bug.cgi?id=16502
--- Comment #4 from Roman <freeslave93 at gmail.com> ---
(In reply to greenify from comment #3)
> So when I execute the program it prints:
>
> > spawnProcess(): Failed to execute program: Exec format error
>
> from here:
>
> https://github.com/dlang/phobos/blob/
> 3f8298e8531b36dd12420af7ce868e5b2f156f27/std/process.d#L504
>
> If I understand you correctly you want to catch this C API error?
> This seems me a very valid enhancement request.
>
> > Error reporting can be implemented via pipe.
>
> Hmm do you know how much overhead this would cost?
> (introducing something that increases the cost vs. C API always needs a very
> good justification)
It prints error, but does not throw exception. Also it obviously will print
nothing if stderr was redirected to /dev/null.
I'm not sure about overhead. I just saw similar method in Qt QProcess code.
But what I'm sure about is that this error should be propagated to user right
way (which for D is throwing the exception).
--
More information about the Digitalmars-d-bugs
mailing list