From: Charlie Garrison Date: Wed, 19 Oct 2016 02:58:22 +0000 (+1100) Subject: Removed check for ancient error results when… X-Git-Tag: v1.001038~2^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=87890302bbd02a3992e919df3a43054d4b113cef;p=dbsrgits%2FDBIx-Class-Fixtures.git Removed check for ancient error results when… 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 --- diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index 5c5dc04..65806ed 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -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;