【发布时间】:2012-11-25 10:26:19
【问题描述】:
目前我在 try catch 中使用 try catch ?当前的场景在我们的应用程序中需要它。
void MyFun()
{
try
{
//Process logic 1
// ......
try
{
//Process logic 2
// ......
} catch (Exception ex)
{
//write an error details in database
}
//Process Logic 3
// ......
} catch (Exception ex)
{
//show error msg
}
}
【问题讨论】:
-
视情况而定,但通常嵌套的 try/catch 是完全有效的。