mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-11 18:35:18 +00:00
Merge pull request #1803 from group-3-sPRinter/fix/litellm-exception-order
fix: reorder exception handling in `LiteLLMAIHandler.chat_completion()`
This commit is contained in:
commit
dd17aadfe3
1 changed files with 3 additions and 3 deletions
|
|
@ -371,12 +371,12 @@ class LiteLLMAIHandler(BaseAiHandler):
|
|||
get_logger().info(f"\nUser prompt:\n{user}")
|
||||
|
||||
response = await acompletion(**kwargs)
|
||||
except (openai.APIError, openai.APITimeoutError) as e:
|
||||
get_logger().warning(f"Error during LLM inference: {e}")
|
||||
raise
|
||||
except (openai.RateLimitError) as e:
|
||||
get_logger().error(f"Rate limit error during LLM inference: {e}")
|
||||
raise
|
||||
except (openai.APIError, openai.APITimeoutError) as e:
|
||||
get_logger().warning(f"Error during LLM inference: {e}")
|
||||
raise
|
||||
except (Exception) as e:
|
||||
get_logger().warning(f"Unknown error during LLM inference: {e}")
|
||||
raise openai.APIError from e
|
||||
|
|
|
|||
Loading…
Reference in a new issue