Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error handling for invalid user input in main.py #31

Open
maks-ivanov opened this issue Apr 12, 2023 · 1 comment
Open

Add error handling for invalid user input in main.py #31

maks-ivanov opened this issue Apr 12, 2023 · 1 comment

Comments

@maks-ivanov
Copy link
Owner

Currently, main.py asks the user to input data via input() calls. If the user writes something unexpected, the whole script will fail.
Add exception handling blocks around input so when user input is bad, it prompts to try again.

@maks-ivanov
Copy link
Owner Author

Planner Agent Output: 1. Use the 'git-new-branch' tool with the input 'error-handling' to create a new branch called 'error-handling'.
2. In main.py, identify all input() calls.
3. For each input() call, wrap it in a while loop and a try-except block.
4. In the try block, read the user input and validate it. If it's valid, break the loop.
5. In the except block, print an error message and continue the loop.
6. Commit the changes to main.py using the 'git-commit' tool with the input 'main.py'.
7. Create a pull request for the 'error-handling' branch using the 'git-create-pull-request' tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant