Correct handling of exceptions of child process