mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 10:55:17 +00:00
fix: reorder exception handling to enable proper retry behavior
This commit is contained in:
parent
6d9bb93f62
commit
6405284461
1 changed files with 3 additions and 3 deletions
|
|
@ -371,12 +371,12 @@ class LiteLLMAIHandler(BaseAiHandler):
|
||||||
get_logger().info(f"\nUser prompt:\n{user}")
|
get_logger().info(f"\nUser prompt:\n{user}")
|
||||||
|
|
||||||
response = await acompletion(**kwargs)
|
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:
|
except (openai.RateLimitError) as e:
|
||||||
get_logger().error(f"Rate limit error during LLM inference: {e}")
|
get_logger().error(f"Rate limit error during LLM inference: {e}")
|
||||||
raise
|
raise
|
||||||
|
except (openai.APIError, openai.APITimeoutError) as e:
|
||||||
|
get_logger().warning(f"Error during LLM inference: {e}")
|
||||||
|
raise
|
||||||
except (Exception) as e:
|
except (Exception) as e:
|
||||||
get_logger().warning(f"Unknown error during LLM inference: {e}")
|
get_logger().warning(f"Unknown error during LLM inference: {e}")
|
||||||
raise openai.APIError from e
|
raise openai.APIError from e
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue