[Issue 16502] spawnProcess does not throw on exec errors

2017-06-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

greensunn...@gmail.com changed:

   What|Removed |Added

 CC||greensunn...@gmail.com

--- Comment #6 from greensunn...@gmail.com ---
> Fixed in https://github.com/dlang/phobos/pull/5431


@Roman: If you reference the Bugzilla issue(s) in your PRs, they will be
automatically closed & you don't need to keep track of them manually ;-)

https://github.com/dlang-bots/dlang-bot#automated-references

There are other advantages of doing this as well, e.g. referenced issues will
be listed on the changelog.

--


[Issue 16502] spawnProcess does not throw on exec errors

2017-06-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

--- Comment #5 from Roman  ---
Fixed in https://github.com/dlang/phobos/pull/5431

--


[Issue 16502] spawnProcess does not throw on exec errors

2017-06-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

Roman  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16502] spawnProcess does not throw on exec errors

2016-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

--- Comment #4 from Roman  ---
(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).

--


[Issue 16502] spawnProcess does not throw on exec errors

2016-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

greenify  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #3 from greenify  ---
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)

--


[Issue 16502] spawnProcess does not throw on exec errors

2016-09-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

--- Comment #2 from Roman  ---
(In reply to b2.temp from comment #1)
> Why should it ?
> 
> You can check the exit status, read stderr if your process is piped and
> throw if you like. As example can you give any language whose the process
> methods, as implemented in their standard libraries, throw ?

The example is right in the std.process: spawnProcess throws if file is not
executable or working directory does not exist.

Reading stderr and exit status is different from handling the situation where
process could not start at all.

--


[Issue 16502] spawnProcess does not throw on exec errors

2016-09-17 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16502

--- Comment #1 from b2.t...@gmx.com ---
Why should it ?

You can check the exit status, read stderr if your process is piped and throw
if you like. As example can you give any language whose the process methods, as
implemented in their standard libraries, throw ?

--