Imagine that you have a method with the following signature:
public void DoSomething(Guid id)
If Guid.Emtpy
represents an illegal value, which Exception type would it be most appropriate to throw? ArgumentException or ArgumentOutOfRangeException?
I'm leaning slightly towards ArgumentException, since I don't think that all Guids except Guid.Empty is much of a range - it's a bit too inclusive: There is only one excluded member.
However, I am in no way determined that this should be the case, so I'd like to hear if anyone can provide arguments for one or the other?
I'm well aware that this is mainly a semantic discussion, but in the interest of good API design I'd still like to know whether there are clear cases for one or the other option.