From: Ton Voon Date: Mon, 17 May 2010 14:23:57 +0000 (+0000) Subject: Fixed exception logic due to not being able to use return with a catch{} X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf0d15addaf1782c0b43b3f4a8293fab64a2f9ad;p=dbsrgits%2FDBIx-Class-Historic.git Fixed exception logic due to not being able to use return with a catch{} --- diff --git a/lib/DBIx/Class/InflateColumn/DateTime.pm b/lib/DBIx/Class/InflateColumn/DateTime.pm index 9d8c61b..42b535e 100644 --- a/lib/DBIx/Class/InflateColumn/DateTime.pm +++ b/lib/DBIx/Class/InflateColumn/DateTime.pm @@ -170,10 +170,13 @@ sub register_column { my ($dt, $err); try { $dt = $obj->_inflate_to_datetime( $value, \%info ) } - catch {; - return undef if ($undef_if_invalid); - $self->throw_exception ("Error while inflating ${value} for ${column} on ${self}: $_"); + catch { + $err = 1; + if (! $undef_if_invalid) { + $self->throw_exception ("Error while inflating ${value} for ${column} on ${self}: $_"); + } }; + return undef if $err; return $obj->_post_inflate_datetime( $dt, \%info ); },