check for failed compile
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / DeployMethod / SQL / Translator.pm
index 996a58b..e64dd2c 100644 (file)
@@ -224,7 +224,9 @@ sub preinstall_scripts {
       no warnings 'redefine';
       eval "package $package;\n\n$filedata";
       use warnings;
-      if (my $fn = $package->can('run')) {
+               if ($@) {
+        carp "$filename failed to compile: $@";
+               } elsif (my $fn = $package->can('run')) {
         $fn->()
       } else {
         carp "$filename should define a run sub but it didn't!";