Protect DBIC as best we can from the failure mode in 7cb35852
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship / BelongsTo.pm
index f6ce3a5..a3e7dbc 100644 (file)
@@ -7,6 +7,7 @@ package # hide from PAUSE
 use strict;
 use warnings;
 use Try::Tiny;
+use DBIx::Class::_Util 'dbic_internal_try';
 use namespace::clean;
 
 our %_pod_inherit_config =
@@ -41,7 +42,7 @@ sub belongs_to {
     )  unless $class->has_column($f_key);
 
     $class->ensure_class_loaded($f_class);
-    my $f_rsrc = try {
+    my $f_rsrc = dbic_internal_try {
       $f_class->result_source_instance;
     }
     catch {
@@ -101,14 +102,4 @@ sub belongs_to {
   return 1;
 }
 
-# Attempt to remove the POD so it (maybe) falls off the indexer
-
-#=head1 AUTHORS
-#
-#Alexander Hartmaier <Alexander.Hartmaier@t-systems.at>
-#
-#Matt S. Trout <mst@shadowcatsystems.co.uk>
-#
-#=cut
-
 1;