Delphi / Object Pascal · Exception
What does EArgumentException Exception mean in Delphi / Object Pascal?
Raised when a routine or method is called with an argument it can't make sense of - an out-of-domain value, the wrong combination of parameters, or a value that fails an internal validation check the method performs on its inputs.
Raised when a routine or method is called with an argument it can't make sense of - an out-of-domain value, the wrong combination of parameters, or a value that fails an internal validation check the method performs on its inputs.
When catching this, check the exact values passed to the failing call against that method's documented valid ranges or combinations; when raising it for custom validation, include the offending value and parameter name in the message.