Dave Rolsky <[EMAIL PROTECTED]> schrieb/wrote:
> Fatal errors are a _good_ thing.  Forging ahead with bad data and _not_
> getting errors is a very, very, very bad thing.

DBI has an option RaiseError. We could:

. have a variable $DateTime::AutoRaise (which should be overridden using
  local)
. have a class factory (in DT::Format) that does the correct
  thing given input from parsers, i.e.:

  . returns a DateTime object if everything is correct.
  . returns a DateTime::Partial object if some data is missing.
  . returns a DateTime::Undef or throws an exception if there's
    incorrect data, depending on the setting of $DateTime::AutoRaise.

Parsers should only parse; all of the above is common code that should
not be re-implemented in all parsers.

Claus
-- 
http://www.faerber.muc.de

Reply via email to