Adding a pattern for returning 'unhandled' exception information via

middleware.

This should be used where posssible instead of throwing an exception and
catching in a test, as that only works in memory.