Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when PC is offline or network off #34

Open
swaipdev opened this issue Jan 2, 2025 · 2 comments
Open

Unhandled exception when PC is offline or network off #34

swaipdev opened this issue Jan 2, 2025 · 2 comments

Comments

@swaipdev
Copy link

swaipdev commented Jan 2, 2025

Hi,

I'm working on a local fallback for when Elevenlabs should not work, or the Internet would be down, or no connection.
I stumble upon an unhandled exception here:

helpers.py, line 730, in _api_tts_with_concurrency
response_json = e.response.json()
AttributeError: 'NoneType' object has no attribute 'json'

I think it's because there's no response at all from Elevenlabs, since the PC is offline.

This is the function:

def _api_tts_with_concurrency(requestFunction:callable, generationID:str, generationQueue:_PeekQueue) -> requests.Response:
#Just a helper function which does all the concurrency stuff for TTS calls.
waitMultiplier = 1
response = None
try:
response = requestFunction()
response.raise_for_status() #Just in case the callable isn't a function that already does this.
except requests.exceptions.RequestException as e:
response_json = e.response.json()
response_handled = False

Can you fix this in the next version?
You can reproduce the bug by going offline after initialising the lib

Thanks

@lugia19
Copy link
Owner

lugia19 commented Jan 13, 2025

Noted, will fix. Library isn't abandoned or anything, just under heavy exam crunch atm. Will pick development back up and update all the stuff that needs updating in the 2nd half of february, probably.

@igoor-asso
Copy link

Thank you for your answer. We're still using your lib, so a fix would be excellent to help us in the fallback process. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants