Call logger.exception correctly

https://docs.python.org/2/library/logging.html#logging.Logger.exception "This method should only be called from an exception handler."