Reinstate the test client exception debugging code, without breaking production sites, hopefully.
Merge commit 'a7d09eb'