request: log an exception when returning an error

Exception logging is only done at debug level. This helps understanding
why a user gets some error.