![](/img/trans.png)
[英]Exception handling in async Methods MVC. How to use try catch for method called using await?
[英]How can i deny continue the sub code lines after the try catch exception handling in public static void mvc property
我有一个 static class 和一些 static 空属性。
public static class Payment
{
public static void ChargeTask(int paymentId)
{
//some code
try
{
//some code
}
catch
{
//handle the exceptions.
how can i exit in this property
}
//deny continue this codes
}
}
在尝试捕获异常处理后,我如何拒绝继续子代码行?
您可以像这样使用return
关键字:
public static class Payment
{
public static void ChargeTask(int paymentId)
{
//some code
try
{
//some code
}
catch
{
//handle the exceptions.
return;
}
//deny continue this codes
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.