X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FDBIx%2FClass.pm;fp=lib%2FSQL%2FTranslator%2FParser%2FDBIx%2FClass.pm;h=4cc21f0b0e217a546016416447a4d3c2db21cd6b;hb=ddcc02d14d03169c54c65db9f0f446836483ba55;hp=59aec2af184aaf9d06e3dfea1aad5dbf0d9d2424;hpb=db83437ef48f4571e1d225572cc7235eb5e64fe3;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index 59aec2a..4cc21f0 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -15,6 +15,7 @@ $DEBUG = 0 unless defined $DEBUG; use Exporter; use SQL::Translator::Utils qw(debug normalize_name); use DBIx::Class::Carp qw/^SQL::Translator|^DBIx::Class|^Try::Tiny/; +use DBIx::Class::_Util 'dbic_internal_try'; use DBIx::Class::Exception; use Class::C3::Componentised; use Scalar::Util 'blessed'; @@ -54,7 +55,7 @@ sub parse { DBIx::Class::Exception->throw('No DBIx::Class::Schema') unless ($dbicschema); if (!ref $dbicschema) { - try { + dbic_internal_try { Class::C3::Componentised->ensure_class_loaded($dbicschema) } catch { DBIx::Class::Exception->throw("Can't load $dbicschema: $_"); @@ -175,7 +176,7 @@ sub parse { # Ignore any rel cond that isn't a straight hash next unless ref $rel_info->{cond} eq 'HASH'; - my $relsource = try { $source->related_source($rel) }; + my $relsource = dbic_internal_try { $source->related_source($rel) }; unless ($relsource) { carp "Ignoring relationship '$rel' on '$moniker' - related resultsource '$rel_info->{class}' is not registered with this schema\n"; next;