From cafc8a5e763834a26432c467abfe84f140bb7d80 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Apr 2004 02:05:48 +0000 Subject: [PATCH] r363: nicer error handling in pidl --- source/build/pidl/pidl.pl | 3 ++- source/build/pidl/util.pm | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/build/pidl/pidl.pl b/source/build/pidl/pidl.pl index c43d042b57a..b390ba77289 100755 --- a/source/build/pidl/pidl.pl +++ b/source/build/pidl/pidl.pl @@ -124,8 +124,9 @@ sub process_file($) } } else { $pidl = util::LoadStructure($pidl_file); + defined $pidl || die "Failed to load $pidl_file - maybe you need --parse\n"; } - + if ($opt_dump) { print IdlDump::Dump($pidl); } diff --git a/source/build/pidl/util.pm b/source/build/pidl/util.pm index 2a4c0de74d9..d09347f22d0 100644 --- a/source/build/pidl/util.pm +++ b/source/build/pidl/util.pm @@ -10,6 +10,7 @@ sub LoadStructure($) { my $f = shift; my $contents = FileLoad($f); + defined $contents || return undef; return eval "$contents"; }