【发布时间】:2011-03-18 15:27:13
【问题描述】:
try {
if (isFileDownloaded)
// do stuff
else
throw new CustomException()
}
catch (Exception e)
{
// something went wrong to save the error to log
}
finally
{
//release resources
}
我的问题是catch 会捕获在 try 块中抛出的ApplicationException 吗?是不是编码风格很差?
应该换成别的写法吗?
【问题讨论】:
-
什么是
ApplicationException?
标签: c# exception try-catch-finally