Try to make connecting to printer more robust to errors.