Why is .NET exception not caught by try/catch block?

前端 未结 25 791
Happy的楠姐
Happy的楠姐 2020-12-04 19:24

I\'m working on a project using the ANTLR parser library for C#. I\'ve built a grammar to parse some text and it works well. However, when the parser comes across an illeg

25条回答
  •  不知归路
    2020-12-04 19:45

    I don't get it...your catch block just throws a new exception (with the same message). Meaning that your statement of:

    The problem is that in some cases (not all) that my try/catch block won't catch it and instead stops execution as an unhandled exception.

    is exactly what is expected to happen.

提交回复
热议问题