Fix the fcgi script tests.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ScriptRunner.pm
index 08fd66e..247ce30 100644 (file)
@@ -11,10 +11,9 @@ sub run {
 
     lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
 
-    # FIXME - Error handling / reporting
-    if ( eval { Class::MOP::load_class($classtoload) } ) {
-    }
-    else {
+    unless ( eval { Class::MOP::load_class($classtoload) } ) {
+        warn("Could not load $classtoload - falling back to Catalyst::Script::$scriptclass : $@\n")
+            if $@ !~ /Can't locate/;
         $classtoload = "Catalyst::Script::$scriptclass";
         Class::MOP::load_class($classtoload);
     }
@@ -38,6 +37,13 @@ Catalyst::ScriptRunner - The Catalyst Framework script runner
 This class is responsible for running scripts, either in the application specific namespace
 (e.g. C<MyApp::Script::Server>), or the Catalyst namespace (e.g. C<Catalyst::Script::Server>)
 
+=head1 METHODS
+
+=head2 run ($application_class, $scriptclass)
+
+Called with two parameters, the application classs (e.g. MyApp)
+and the script class, (i.e. one of Server/FastCGI/CGI/Create/Test)
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm