Improved error handling ai_code_reviewer.py
Enhanced the syntax error message to include the line and column number for easier debugging, added a general exception catch to handle unexpected errors during AST parsing and wrapped each check method call inside _safe_check to handle exceptions for each specific check.
Description
Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.
Fixes #(issue_no)
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Documentation Update
Checklist:
- [x] My code follows the style guidelines(Clean Code) of this project
- [x ] I have performed a self-review of my own code
- [x ] I have commented my code, particularly in hard-to-understand areas
- [ x] I have created a helpful and easy to understand
README.md - [ x] My documentation follows
Template for README.md - [ x] I have added the project meta data in the PR template.
- [ x] I have created the
requirements.txtfile if needed.
Project Metadata
If there is no-file/nothing to fill the below fields with, then type: none
Example: If no requirements.txt needed/present, then type none in Requirments.
Category:
- [ ] Calculators
- [x ] AI/ML
- [ ] Scrappers
- [ ] Social_Media
- [ ] Image_Processing
- [ ] Video_Processing
- [ ] Games
- [ ] Networking
- [ ] OS_Utilities
- [ ] Automation
- [ ] Cryptography
- [ ] Computer_Vision
- [ ] Fun
- [ ] Others
Title: <write script title here>
Folder: <type the folder name that contains your script>
Requirements: <type the name of text file containing the required to install python packages, type None if no file required>
Script: <Enter the name of the .py file (The main entry point of the program)>
Arguments: <enter any arguments that the script needs but - separeted like: h-c-m>
Contributor: <Enter your Github handle/username without url>
Description: <Enter a one line description that describes your script. Also, explain the arguments usage here>