This lead to fix most other places where we show exception in the log.
I also replaced the `log.error(..., exc_info=True)` with calls to `exception_to_unicode`, as the former will hide the unicode strings if any, showing "<unprintable Exception object>" instead.
Closes #7935.