X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FVersioned.pm;h=d59961fec14f07e1102239bbb49a9996e224d067;hb=ddcc02d14;hp=ba3b44523513ed6bc6a509ddf27295ab25a945c2;hpb=db83437ef48f4571e1d225572cc7235eb5e64fe3;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index ba3b445..d59961f 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -202,8 +202,8 @@ use warnings; use base 'DBIx::Class::Schema'; use DBIx::Class::Carp; +use DBIx::Class::_Util 'dbic_internal_try'; use Time::HiRes qw/gettimeofday/; -use Try::Tiny; use Scalar::Util 'weaken'; use namespace::clean; @@ -527,7 +527,7 @@ sub get_db_version my ($self, $rs) = @_; my $vtable = $self->{vschema}->resultset('Table'); - my $version = try { + my $version = dbic_internal_try { $vtable->search({}, { order_by => { -desc => 'installed' }, rows => 1 } ) ->get_column ('version') ->next; @@ -746,14 +746,15 @@ sub _read_sql_file { sub _source_exists { - my ($self, $rs) = @_; - - return try { - $rs->search(\'1=0')->cursor->next; - 1; - } catch { - 0; - }; + my ($self, $rs) = @_; + + ( dbic_internal_try { + $rs->search(\'1=0')->cursor->next; + 1; + } ) + ? 1 + : 0 + ; } =head1 FURTHER QUESTIONS?