【发布时间】:2017-09-06 09:12:17
【问题描述】:
如果这里的 OracleException 不是我想要的,这里会发生什么?我需要扔吗?在这里也捕获一个通用异常是正确的做法吗?
try
{
does some code
}
catch (OracleException ex)
{
if (ex.Number == 20001)
{
throw new ValidationException("Unable blah blah blah");
}
throw;
}
catch (Exception ex)
{
// Log it
TraceHelper.WriteLine("Exception updating tblah + Environment.NewLine + ex.StackTrace, MessageCategory.Error);
throw;
}
【问题讨论】:
标签: c# .net exception exception-handling