Re: Catch process exception

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Thanks, but can I use this method to get ending reason of
app(exception,user ending, etc...).


From the code you provided, I was under the impression you were trying to
capture an error message the app writes to stderr. Is that accurate?

According to the documentation for GetExitCodeProcess, an application that
ends with an unhandled exception should terminate, and the exit code should
be the exception. But maybe the exception isn't unhandled, and the
application catches it and exits normally... in that case your only option
is to check for any error event the application might leave (could be a log
file, Windows Event Log, message on stdout or stderr, etc.)


.



Relevant Pages

  • Re: wayward system() call errors
    ... I have a question regarding the C "system" call in a UNIX ... an error message to stderr. ... the error message from the shell ... gets written to my new transaction log file mentioned in paragraph 1. ...
    (comp.unix.programmer)
  • Re: Process p = Runtime.getRuntime().exec(String cmd) not reading input stream on Linux
    ... input stream actually contains nothing and does complete. ... that it's giving you an error message on stderr which you are not showing. ... putting into cmd. ...
    (comp.lang.java.programmer)
  • Re: Rename Perl Process
    ... Filehandles, and killing the parent. ... Do you realize that the error message from die can't make it ... Unless the close of STDERR itself failed. ... the parent process exit) and setting a new session in between ...
    (comp.lang.perl.misc)
  • Re: question
    ... "int main{" ... you printed an error message and terminated the program. ... You're asking fread() to read 512 element, ... it's conventional to print error messages to stderr, ...
    (comp.lang.c)
  • Re: Win XP: Problem with shell scripting in Python
    ... return the error message into the string: ... the difference between STDOUT and STDERR, and the difference between buffered output and non-buffered output, and perhaps a few other things related to how STDIO behaves on modern computers... ... rewriting BAT files as a series of os.system or os.popen calls isn't exactly optimal; better take an hour to skim the "generic operating system services" section in the library reference, and use built-in functions wherever you can: ...
    (comp.lang.python)