I have the security component in one of my comment submit forms.. Now, when something goes wrong, and the blackhole callback is called, I want to throw an InternalErrorException with a custom message, such as:
throw new InternalErrorException('You have tried to submit a comment whose security token is either invalid or expired. Please try again by reloading the blog post and commenting again. Thank you.');
The thing is that the message does not get displayed in production mode (debug == 0). What do I have to do to show the message to the user instead of "An Internal Error Has Occurred"?
This is my error500.ctp: http://pastebin.com/t9NuzuqS