Use logger.exception for logging retries
Make shorten_url return a bytestring