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

Update Shopping-list.py #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shaswat098
Copy link

Added Exception Handling in the load_list function.

The try-except block handles potential errors:

1)FileNotFoundError: If the specified filename does not exist or cannot be found (though this is uncommon in write mode, it could happen if there's a directory issue), the program will print "File not found."

2)ValueError: If the list is empty, it catches the ValueError raised and prints the error message.

3)General Exception Handling: If any other exception occurs, it prints a message along with the error details.

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

Successfully merging this pull request may close these issues.

1 participant