Removed check for ancient error results when…
Charlie Garrison [Wed, 19 Oct 2016 02:58:22 +0000 (13:58 +1100)]
getting DateTime formatter from schema storage.

Error can occur earlier in code, unrelated to datetime formatter, and cause formatter to not be set. Don’t bail due to ancient errors.

Signed-off-by: Charlie Garrison <cngarrison@gmail.com>

lib/DBIx/Class/Fixtures.pm

index 5c5dc04..65806ed 100644 (file)
@@ -867,8 +867,8 @@ sub dump_object {
 
     # mess with dates if specified
     if ($set->{datetime_relative}) {
-      my $formatter= $object->result_source->schema->storage->datetime_parser;
-      unless ($@ || !$formatter) {
+      my $formatter= eval {$object->result_source->schema->storage->datetime_parser};
+      unless (!$formatter) {
         my $dt;
         if ($set->{datetime_relative} eq 'today') {
           $dt = DateTime->today;