Permalink
Browse files

migrated the error message to Lint

  • Loading branch information...
1 parent b5be306 commit d9e1ee4deff1c52b4efce5cd1a56f937f8526102 @miyagawa miyagawa committed Apr 20, 2010
Showing with 2 additions and 5 deletions.
  1. +1 −1 lib/Plack/Middleware/Lint.pm
  2. +1 −4 lib/Plack/Util.pm
View
2 lib/Plack/Middleware/Lint.pm
@@ -10,7 +10,7 @@ sub wrap {
my($self, $app) = @_;
unless (ref $app eq 'CODE' or overload::Method($app, '&{}')) {
- Carp::croak("PSGI app should be a code reference: $app");
+ Carp::croak("PSGI app should be a code reference: ", (defined $app ? $app : "undef"));
}
$self->SUPER::wrap($app);
View
5 lib/Plack/Util.pm
@@ -125,10 +125,7 @@ sub load_psgi {
die "Error while loading $file: $@" if $@;
return $app->to_app if $app and Scalar::Util::blessed($app) and $app->can('to_app');
- return $app if $app and (ref $app eq 'CODE' or overload::Method($app, '&{}'));
-
- Carp::croak( "$file did not return a PSGI app handler code reference. Instead it returned: "
- . ( defined $app ? $app : 'undef' ));
+ return $app;
}
sub run_app($$) {

0 comments on commit d9e1ee4

Please sign in to comment.