From: Arthur Axel 'fREW' Schmidt Date: Sun, 28 Mar 2010 17:26:25 +0000 (-0500) Subject: error message for arbitrary perl X-Git-Tag: v0.001000_01~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=98c9484a85f334c76d3cb667858209e53c92b477;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git error message for arbitrary perl --- diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 6d00bdd..b742588 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -172,7 +172,11 @@ method _run_sql_and_perl($filenames) { eval "package $package;\n\n$filedata"; use warnings; - $package->can('run')->($self->schema); + if (my $fn = $package->can('run')) { + $fn->($self->schema); + } else { + carp "$filename should define a run method that takes a schema but it didn't!"; + } } else { croak "A file got to deploy that wasn't sql or perl!"; }