How to catch exceptions from processes in C#

后端 未结 1 987
傲寒
傲寒 2020-12-11 19:11

I have an acceptance runner program here that looks something like this:

public Result Run(CommandParser parser)
{
    var result = new Result();
    var wat         


        
相关标签:
1条回答
  • 2020-12-11 19:25

    Exceptions don't flow from one process to another. The best you could do would be to monitor the exit code of the process - conventionally, an exit code of 0 represents success, and any other exit code represents an error.

    Whether that's the case for the processes you're launching is a different matter, of course.

    0 讨论(0)
提交回复
热议问题