avoid long lines

It is a coding style violation.
log exceptions

Don't just throw away the useful error messages!
also log previous exception message when available
Merge pull request #2446 from greg0ire/log_previous_exceptions

[2.3] Log previous exceptions