And deletes it if it encounters an error whilst loading it. A non-functional
lib/buildcustomize.pl will cause the build to fail with seemingly unrelated
errors. Deleting it and exiting with an error should make the cause of build
failures obvious.
close $fh
or warn "Can't unlink $file after error: $!";
} else {
- close $fh and exit;
- $error = "Can't close $file: $!";
+ if (close $fh) {
+ do $file and exit;
+ $error = "Can't load generated $file: $@";
+ } else {
+ $error = "Can't close $file: $!";
+ }
}
# It's going very wrong, so try to remove the botched file.