I made a few tries and I think I've understood your problem.
So when you want to create a personalized error page, first you need to add, under the template directory, the following path, same as your link said
templates/
└─ bundles/
└─ TwigBundle/
└─ Exception/
├─ error404.html.twig
├─ error403.html.twig
└─ error.html.twig # All other HTML errors (including 500)
The most common error is the 500 so you can add this: error500.html.twig
or just leave the generic one, it's up to you.
The importamt thing is that whenever you add a file error in the directory or you simply make a change in an existing file: you MUST launch the command to clear the cache (you can only launch this command when the project has no errors). If you don’t do this the changes wont be visualized.
STEPS:
- fix the error or start from a previous working build
- launch the clear command:
php binconsole cache:clear
,
you'll get something like that result_of_clear_cache
- refresh the page and you should see the new page
PS. if you need some visual references:
path
error_file
result_on_browser
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…