Log network and unexpected exceptions if logging is enabled.
Merge pull request #276 from square/jw/log-exceptions

Log network and unexpected exceptions if logging is enabled.