mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(openrouter/chat/transformation.py): raise informative message for openrouter key error (#9626)
Related Issue: https://github.com/Aider-AI/aider/issues/3550#issuecomment-2763052355
This commit is contained in:
parent
220d4c07f4
commit
4879e1ecf0
1 changed files with 6 additions and 0 deletions
|
|
@ -84,5 +84,11 @@ class OpenRouterChatCompletionStreamingHandler(BaseModelResponseIterator):
|
|||
model=chunk["model"],
|
||||
choices=new_choices,
|
||||
)
|
||||
except KeyError as e:
|
||||
raise OpenRouterException(
|
||||
message=f"KeyError: {e}, Got unexpected response from OpenRouter: {chunk}",
|
||||
status_code=400,
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue