use Scalar::Util ();
use base qw/DBIx::Class/;
+use Try::Tiny;
=head1 NAME
# condition resolution may fail if an incomplete master-object prefetch
# is encountered - that is ok during prefetch construction (not yet in_storage)
- my $cond = eval { $source->_resolve_condition( $rel_info->{cond}, $rel, $self ) };
- if (my $err = $@) {
+ my $cond;
+ try { $cond = $source->_resolve_condition( $rel_info->{cond}, $rel, $self ) }
+ catch {
if ($self->in_storage) {
- $self->throw_exception ($err);
+ $self->throw_exception ($_);
}
else {
$cond = $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION;
}
- }
+ };
if ($cond eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
my $reverse = $source->reverse_relationship_info($rel);