I seem to recall a way of altering the configuration to turn off the code dump, but that may have disappeared with the move to 4.0. Anyway, in a 4.x system, a possible way to go is to change /packages/acs-templating/resources/messages/request-error.*
You could easily make this configurable by adding a parameter to
the acs-templating package (or somewhere else?) to turn it on or off.