r363: nicer error handling in pidl
authorAndrew Tridgell <tridge@samba.org>
Mon, 26 Apr 2004 02:05:48 +0000 (02:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:35 +0000 (12:51 -0500)
(This used to be commit cafc8a5e763834a26432c467abfe84f140bb7d80)

source4/build/pidl/pidl.pl
source4/build/pidl/util.pm

index c43d042b57a0c294452e3d0b6445fd75df569b2d..b390ba77289279d8f9427d938463de472d0ca182 100755 (executable)
@@ -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);
        }
index 2a4c0de74d9a9fc9ecf2a46d29bee42c26513245..d09347f22d0b25a9e0e9629a4d5959a92133c93a 100644 (file)
@@ -10,6 +10,7 @@ sub LoadStructure($)
 {
        my $f = shift;
        my $contents = FileLoad($f);
+       defined $contents || return undef;
        return eval "$contents";
 }