mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-16 19:05:14 +02:00
Ensure retry exception is properly raised (#926)
This commit is contained in:
parent
58b5c5c8d5
commit
913f610db5
1 changed files with 2 additions and 2 deletions
|
|
@ -111,7 +111,7 @@ class Processor(LlmService):
|
||||||
code = body.get('error', {}).get('code')
|
code = body.get('error', {}).get('code')
|
||||||
if code in ('insufficient_quota', 'invalid_api_key', 'account_deactivated'):
|
if code in ('insufficient_quota', 'invalid_api_key', 'account_deactivated'):
|
||||||
raise RuntimeError(f"OpenAI unrecoverable error: {code} - {body['error'].get('message', '')}")
|
raise RuntimeError(f"OpenAI unrecoverable error: {code} - {body['error'].get('message', '')}")
|
||||||
except Exception:
|
except (ValueError, KeyError, TypeError, AttributeError):
|
||||||
pass
|
pass
|
||||||
# Leave rate limit retries to the base handler
|
# Leave rate limit retries to the base handler
|
||||||
raise TooManyRequests()
|
raise TooManyRequests()
|
||||||
|
|
@ -204,7 +204,7 @@ class Processor(LlmService):
|
||||||
if code in ('insufficient_quota', 'invalid_api_key', 'account_deactivated'):
|
if code in ('insufficient_quota', 'invalid_api_key', 'account_deactivated'):
|
||||||
logger.warning(f"Hit unrecoverable rate limit error during streaming: {code}")
|
logger.warning(f"Hit unrecoverable rate limit error during streaming: {code}")
|
||||||
raise RuntimeError(f"OpenAI unrecoverable error: {code} - {body['error'].get('message', '')}")
|
raise RuntimeError(f"OpenAI unrecoverable error: {code} - {body['error'].get('message', '')}")
|
||||||
except Exception:
|
except (ValueError, KeyError, TypeError, AttributeError):
|
||||||
pass
|
pass
|
||||||
logger.warning("Hit rate limit during streaming")
|
logger.warning("Hit rate limit during streaming")
|
||||||
raise TooManyRequests()
|
raise TooManyRequests()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue