title: Throwing exceptions from a Process.Exited handler
body: <p>I have a program which runs an external, command line utility and reads the standard output (a PNG image.)  Originally during testing, I had the command line program write the image to a temporary file, and then loaded the file into the program. I had a handler for Process.Exited which threw an exception if the exit code was nonzero.  I called WaitForExit before loading the temporary image to make sure that the process was finished. If an exception was raised, it was handled in the code which read the temporary image file.  Now, I make the call to create the image file directly after calling Process.Start, which works fine if there is no error.  If the external program exits abnormally, the exception thrown by the exit handler is no longer caught by my code.  If I call WaitForExit before I read the standard output, the program hangs.  Is there any way to catch the exception thrown by the exit handler without calling WaitForExit?</p>