mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework
https://mojolicious.org
Artistic License 2.0
2.66k stars 576 forks source link

Non-existent template file gives 404 error, should be 500 #1728

Closed DrHyde closed 3 years ago

DrHyde commented 3 years ago

Steps to reproduce the behavior

Run this and then visit http://127.0.0.1:3000/

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.

jberger commented 3 years ago

This behavior was fixed in 9.0. Please upgrade, test, and reopen if it still doesn't meet your expectations at that point.

DrHyde commented 3 years ago

Ahh, thanks. Confirmed fixed in 9.01.