如果我有一个例程,在两个地方可能会抛出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!");
}
在我的调用过程中,如何最好地确定抛出了哪个异常?
或者
我这样做是不是有问题?
ArgumentNullException
。 - Justin Ethier