【发布时间】:2021-07-13 23:10:12
【问题描述】:
这可能很愚蠢,但是,是否有可能捕获特定异常,然后返回到函数中稍后抛出异常的位置?
例如
Try
{
//trigger exception
//return to function here
//more function
}
catch(Exception e)
{
if (e.Message.Contains("exception message contents"))
{Do the return thing}
}
【问题讨论】:
-
简短的回答是否定的。您能否向我们展示一个更有意义的代码示例,以便我们提供一些建议?并解释你为什么要这样做?
-
你可以查看这个答案:Resumable exception c#