-
-
Save anonymous/2a1bd699f84c83a70173 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/Server.pm b/lib/Mojo/Server.pm | |
index 58c9513..43c6d9e 100644 | |
--- a/lib/Mojo/Server.pm | |
+++ b/lib/Mojo/Server.pm | |
@@ -50,8 +50,8 @@ sub load_app { | |
local $ENV{MOJO_EXE}; | |
# Try to load application from script into sandbox | |
- my $app = eval "package Mojo::Server::Sandbox::@{[md5_sum $path]};" | |
- . 'return do($path) || die($@ || $!);'; | |
+ my $app | |
+ = eval "package Mojo::Server::Sandbox::@{[md5_sum $path]}; do(\$path)"; | |
die qq{Can't load application from file "$path": $@} if !$app && $@; | |
die qq{File "$path" did not return an application object.\n} | |
unless blessed $app && $app->isa('Mojo'); | |
diff --git a/t/mojo/daemon.t b/t/mojo/daemon.t | |
index c32f7ca..52d717c 100644 | |
--- a/t/mojo/daemon.t | |
+++ b/t/mojo/daemon.t | |
@@ -89,7 +89,7 @@ eval { | |
Mojo::Server::Daemon->new->load_app( | |
"$FindBin::Bin/lib/Mojo/LoaderException.pm"); | |
}; | |
-like $@, qr/^Can't load application/, 'right error'; | |
+like $@, qr/did not return an application object/, 'right error'; | |
# Load missing application class | |
eval { Mojo::Server::Daemon->new->build_app('Mojo::DoesNotExist') }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment