Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the exception handling in build_prompt.py when applying a chat template, catching Exception instead of BaseException and raising a ValueError. The reviewer recommends preserving the exception chain by removing from None when raising the ValueError to ensure that the original traceback (such as Jinja2 rendering errors) is not lost, which is important for server-side debugging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| except Exception as e: | ||
| raise ValueError(f"Failed to build prompt: {e}") from None |
There was a problem hiding this comment.
Suppressing the exception context with from None makes it difficult to debug chat template rendering issues on the server side, as the original traceback (e.g., from Jinja2) is lost. Consider preserving the exception chain by raising the ValueError without from None so that the underlying cause is visible in server logs.
| except Exception as e: | |
| raise ValueError(f"Failed to build prompt: {e}") from None | |
| except Exception as e: | |
| raise ValueError(f"Failed to build prompt: {e}") |
No description provided.