} elsif (!ref($try) and ref($more->[0]) eq 'CODE') {
$self->_construct_node(match => $try, run => shift(@$more))->to_app;
} elsif (
+ !ref($try) and blessed($more->[0]) and $more->[0]->isa('Plack::Middleware')
+ ) {
+ die "Middleware needs to be wrapped in a sub.";
+ } elsif (
(blessed($try) && $try->isa('Web::Dispatch::Matcher'))
and (ref($more->[0]) eq 'CODE')
) {
match => $try,
run => shift(@$more)
})->to_app;
+ } elsif (blessed($try) && $try->isa('Plack::Middleware')) {
+ die "Middleware needs a route definition and has to be wrapped in a sub.";
} elsif (blessed($try) && $try->can('to_app')) {
$try->to_app;
} else {