CC: | bsb [...] bereft.net, tjc [...] wintrmute.net |
Subject: | [PATCH] Add missing eval {} to avoid checking old $@ values |
The schema loader, in one location, checks and dies if $@ is set..
however because the prior statement was not inside an eval {} block,
sometimes $@ includes errors from unrelated previous eval's, and thus
causes Loader to die here.
Attached is a patch to fix this behaviour.
Subject: | 0001-Add-eval-around-a-require-to-avoid-false-checks-of-p.patch |
From 8245481402859ade8388b0d2df93e0a03a315089 Mon Sep 17 00:00:00 2001
From: Toby Corkindale <tobyc@strategicdata.com.au>
Date: Wed, 22 Oct 2008 17:22:05 +1100
Subject: [PATCH] Add eval around a require to avoid false checks of previous $@ values.
---
lib/DBIx/Class/Schema/Loader/Base.pm | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm
index fada2be..e91cd29 100644
--- a/lib/DBIx/Class/Schema/Loader/Base.pm
+++ b/lib/DBIx/Class/Schema/Loader/Base.pm
@@ -289,7 +289,9 @@ sub _load_external {
my $real_inc_path = Cwd::abs_path($inc_path);
return if $real_inc_path eq $real_dump_path;
- $class->require;
+ eval {
+ $class->require;
+ };
croak "Failed to load external class definition"
. " for '$class': $@"
if $@;
--
1.5.6.5