ITool GetTool(Guid tool)
{
if (tool == Hammer.Id)
return new Hammer();
else if (tool == Drill.Id)
return new Drill();
else
throw new ....?
}
What’s the most appropriate exception type to throw here? NotSupportedException is the closest I’ve found but I don’t think that’s quite right.
By process of elimination:
ArgumentException(“Unknown tool requested”)