I have the following bit of code in my AppController, which I’m using to intercept a 404 and run some code beforehand. Right now I’ve trimmed it all back to basics whilst debugging.
public function appError($error) {
throw new NotFoundException();
}
The exception name is irrelevent at this point, my problem is its causing a 500 error no matter what exception I throw.
All I want to do is throw a 404 and display my 404 page, which works fine if I enter a non-existent URL into my app.
Is there something that I’m missing at is causing this 500? I can’t get any meaningful error messages, as its just showing the exception error 500.
Throwing an exception inside appError() itself will just cause a loop and cake will bail out with a 500 error