X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FVersioned.pm;h=fe6c6940d45207d06bba45ebd421af96fd7491b6;hb=20674fcd94984d0d2be09ecda7f3c22715468936;hp=aa4f7020d3de857afebaa8d47bafd7f669813b2c;hpb=b703fec7f5767eb8240771f1a07a518b34855768;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index aa4f702..fe6c694 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -503,8 +503,9 @@ sub get_db_version my ($self, $rs) = @_; my $vtable = $self->{vschema}->resultset('Table'); - my $version = eval { - $vtable->search({}, { order_by => { -desc => 'installed' }, rows => 1 } ) + my $version; + try { + $version = $vtable->search({}, { order_by => { -desc => 'installed' }, rows => 1 } ) ->get_column ('version') ->next; }; @@ -723,10 +724,14 @@ sub _source_exists { my ($self, $rs) = @_; - my $c = eval { - $rs->search({ 1, 0 })->count; + my $c; + my $exception; + try { + $c = $rs->search({ 1, 0 })->count; + } catch { + $exception=1; }; - return 0 if $@ || !defined $c; + return 0 if $exception || !defined $c; return 1; }