Permalink
Browse files

Print some diagnostics when app_file fails

  • Loading branch information...
1 parent fbb3664 commit 7ab2eae89ab1a45744a92f2eac47e1ef6090cb93 @stash committed Apr 11, 2011
Showing with 14 additions and 3 deletions.
  1. +14 −3 lib/Feersum/Runner.pm
View
@@ -55,9 +55,20 @@ sub run {
$self->{quiet} or warn "Feersum [$$]: starting...\n";
$self->_prepare();
- my $rh = shift || delete $self->{app} || do $self->{app_file};
- $self->assign_request_handler($rh);
- undef $rh;
+ my $app = shift || delete $self->{app};
+
+ if (!$app && $self->{app_file}) {
+ local ($@, $!);
+ $app = do $self->{app_file};
+ warn "couldn't parse $self->{app_file}: $@" if $@;
+ warn "couldn't do $self->{app_file}: $!" if ($! && !defined $app);
+ warn "couldn't run $self->{app_file}: didn't return anything"
+ unless $app;
+ }
+ die "app not defined or failed to compile" unless $app;
+
+ $self->assign_request_handler($app);
+ undef $app;
$self->{_quit} = EV::signal 'QUIT', sub { $self->quit };

0 comments on commit 7ab2eae

Please sign in to comment.