Skip to content

Commit

Permalink
mention @inc in missing application class error
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 3, 2014
1 parent 9162e45 commit 2290dd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -15,7 +15,7 @@ sub build_app {
my ($self, $app) = @_;
local $ENV{MOJO_EXE};
return $app->new unless my $e = Mojo::Loader->new->load($app);
die ref $e ? $e : qq{Couldn't find application class "$app".\n};
die ref $e ? $e : qq{Couldn't find application class "$app" in \@INC.\n};
}

sub build_tx {
Expand Down
5 changes: 5 additions & 0 deletions t/mojo/daemon.t
Expand Up @@ -69,6 +69,11 @@ eval {
};
like $@, qr/^Couldn't load application/, 'right error';

# Load missing application class
eval { Mojo::Server::Daemon->new->build_app('Mojo::DoesNotExist') };
is $@, qq{Couldn't find application class "Mojo::DoesNotExist" in \@INC.\n},
'right error';

# Transaction
isa_ok $app->build_tx, 'Mojo::Transaction::HTTP', 'right class';

Expand Down

0 comments on commit 2290dd0

Please sign in to comment.