ErrorXxxPresenter not rendering 4xx.latte?

shuseisajdi
Member | 8
+
0
-

Hi,
Just install an original framework.

composer create-project nette/weba-project ./

and HomePresenter.php

namespace App\UI\Home;
use Nette;
final class HomePresenter extends Nette\Application\UI\Presenter
{
    public function renderDefault(): void
    {
        $this->error('Sample Page not found',404 ); <--here
    }
}

and 404.latte

{block content}
<h1 n:block=title>Page Not Found Me!!</h1> <-- here

Surely it is getting to Error4xxPresenter, but it not rendering Error4xx/404.latte.
And I try $this->template->setFile(__DIR__ . '/404.latte'); in Error4xxPresenter. but same.
How to use 4xx.latte, 404.latte in Error4xx/?

shuseisajdi
Member | 8
+
0
-

Oh! So sorry.
I forget my cache.
Delete ‘temp’, then I could change it.

Infanticide0
Member | 107
+
+1
-

Hi @shuseisajdi , set catchExceptions: yes in your neon and you will see error pages with dev mode enabled (you won't have to clean cache after template changes)

application:
	catchExceptions: yes