Skip to content

Commit

Permalink
improved Mojo::Server to die more gracefully if an application class …
Browse files Browse the repository at this point in the history
…could not be found
  • Loading branch information
kraih committed Dec 21, 2012
1 parent f5e97f5 commit bb88978
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Changes
@@ -1,4 +1,9 @@

3.70 2012-12-21
- Improved Mojo::Server to die more gracefully if an application class could
not be found.
- Improved tests.

3.69 2012-12-20
- Deprecated Mojolicious::Routes->namespace in favor of
Mojolicious::Routes->namespaces.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server.pm
Expand Up @@ -19,8 +19,8 @@ sub build_app {
my ($self, $app) = @_;
local $ENV{MOJO_EXE};
local $ENV{MOJO_APP} = $app;
if (my $e = Mojo::Loader->new->load($app)) { die $e if ref $e }
return $app->new;
return $app->new unless my $e = Mojo::Loader->new->load($app);
die ref $e ? $e : qq{Application class "$app" could not be found.\n};
}

sub build_tx { shift->app->build_tx }
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.69';
our $VERSION = '3.70';

sub AUTOLOAD {
my $self = shift;
Expand Down

0 comments on commit bb88978

Please sign in to comment.