Render stack trace when an exception is thrown.

Note: we're not going to show details for HttpStatusException instances here
because these either represent a user-specified response code (in which case a
stack trace is not appropriate) or else they encapsulate the actual exception
that was thrown (in which case their own contribution to the stack trace is
irrelevant and confusing). So we'll only show the details of the inner exception
type, if present. And even then only in debug mode.