my $real_inc_path = Cwd::abs_path($inc_path);
return if $real_inc_path eq $real_dump_path;
- $class->require;
- croak "Failed to load external class definition"
- . " for '$class': $@"
- if $@;
+ # must use $UNIVERSAL::require::ERROR, $@ is not safe. See RT #44444 --kane
+ $class->require or
+ croak "Failed to load external class definition"
+ . " for '$class': $UNIVERSAL::require::ERROR";
# If we make it to here, we loaded an external definition
warn qq/# Loaded external class definition for '$class'\n/
foreach (@_) {
warn "$target: use $_;" if $self->debug;
$self->_raw_stmt($target, "use $_;");
- $_->require or croak ($_ . "->require: $@");
+ $_->require or croak ($_ . "->require: $UNIVERSAL::require::ERROR");
$evalstr .= "package $target; use $_;";
}
eval $evalstr if $evalstr;
warn "$target: use base qw/ $blist /;" if $self->debug && @_;
$self->_raw_stmt($target, "use base qw/ $blist /;") if @_;
foreach (@_) {
- $_->require or croak ($_ . "->require: $@");
+ $_->require or croak ($_ . "->require: $UNIVERSAL::require::ERROR");
$schema_class->inject_base($target, $_);
}
}
my $dbh = $self->schema->storage->dbh;
my $driver = $dbh->{Driver}->{Name};
my $subclass = 'DBIx::Class::Schema::Loader::DBI::' . $driver;
+
+ # must use $UNIVERSAL::require::ERROR, $@ is not safe. See RT #44444 --kane
$subclass->require;
- if($@ && $@ !~ /^Can't locate /) {
+ if($UNIVERSAL::require::ERROR &&
+ $UNIVERSAL::require::ERROR !~ /^Can't locate /
+ ) {
croak "Failed to require $subclass: $@";
}
elsif(!$@) {