【发布时间】:2011-02-20 11:00:07
【问题描述】:
如果我有一个可以在两个地方抛出 ArgumentException 的例程,比如...
if (Var1 == null)
{
throw new ArgumentException ("Var1 is null, this cannot be!");
}
if (Val2 == null)
{
throw new ArgumentException ("Var2 is null, this cannot be either!");
}
在我的调用过程中确定抛出两个异常中的哪一个的最佳方法是什么?
或者
我这样做的方式不对吗?
【问题讨论】:
标签: c# .net asp.net exception-handling