Get error page from controller

I found the solution for how to return the error page content without redirect to the error page here: Manually throw 404 from Controller - #4 by texnixe