[fpc-pascal] Standard exceptions

Michael Fuchs freepascal at ypa-software.de
Tue Mar 1 13:00:56 CET 2011


Am 28.02.2011 18:28, schrieb Jonas Maebe:
> There are no generic equivalents to ArgumentException and
> ArgumentNullException (when asking such questions in the future, you
> may also want to include a reference to a web page that describes
> what they mean, it makes it easier for people to answer you).

Sorry, bad mistake. A simple description of this exceptions or better of 
their possible FPC equivalents:

EArgument
Base exception for argument related exceptions. Contains a property 
ParamName which helds the parameter causing the error.

EArgumentNil (inherits from EArgument):
Thrown if a given parameter to a method is nil and should not.

EArgumentRange (inherits from EArgument):
Thrown if a given parameter to a method is out of range.

ENotImplemented
Thrown if a method implementation is not ready. Nice for 
test-driven-development. Maybe IDEs which generates class 
implementations could start with a "raise ENotImplemted.Create;" in 
method body.

regards
Michael



More information about the fpc-pascal mailing list