In this PR we enhanced error handling for AI-generated commit messages, focusing on Anthropic, OpenAI and ollama API integration.
Implemented a error mapping and improved error reporting in git hooks and cli providing users with clearer guidance on how to proceed when encountering issues such as token limit
Reason behind current approach
This approach implements a sort of centralized way of error handling that is highly scalable! By catching and mapping errors at the service level and then moving them upwards, it allows for consistent error handling and reporting in the higher-level in the upper infra components such as CLI and Git Hook commit processes.
Main Goals
Dev's experience : This design improves user experience by providing more meaningful error messages,
User's experience: Makes it easier to add support for new AI services or error types in the future.
Diagram
Test Plan
CLI
create a .py file and add 8000 random lines of code to it 🤓
Description
In this PR we enhanced error handling for AI-generated commit messages, focusing on
Anthropic
,OpenAI
andollama
API integration.Implemented a error mapping and improved error reporting in git hooks and cli providing users with clearer guidance on how to proceed when encountering issues such as
token limit
Reason behind current approach
This approach implements a sort of centralized way of error handling that is highly scalable! By catching and mapping errors at the service level and then moving them upwards, it allows for consistent error handling and reporting in the higher-level in the upper infra components such as
CLI
andGit Hook
commit processes.Main Goals
Dev's experience : This design improves user experience by providing more meaningful error messages,
User's experience: Makes it easier to add support for new AI services or error types in the future.
Diagram
Test Plan
CLI
create a
.py
file and add 8000 random lines of code to it 🤓Test Procedure (Repeat for each model: OpenAI, Anthropic, Llama)
Expected Output:
Git Hook
create a
.py
file and add 8000 random lines of code to it 🤓Test Procedure (Repeat for each model: OpenAI, Anthropic, Llama)
Expected Output: