use Mojolicious::Lite -signatures;
get '/' => sub ($c) {
print STDERR "Look ma, this route exists!\n";
$c->render(
template => 'no/such/file',
handler => 'ep',
format => 'html',
some_data => 'i like bubbles'
);
};
app->start;
Expected behavior
A 500 error
Actual behavior
A 404 error
404 means that the requested resource, ie /, could not be found, but it clearly is found, as the print to STDERR happens. A 500 error is more appropriate as it signals that the route was found but is broken.
Steps to reproduce the behavior
Run this and then visit http://127.0.0.1:3000/
Expected behavior
A 500 error
Actual behavior
A 404 error
404 means that the requested resource, ie
/
, could not be found, but it clearly is found, as theprint
toSTDERR
happens. A 500 error is more appropriate as it signals that the route was found but is broken.