Replaced IOError with FileNotFoundError on line 320 of main.py to use a more specific and appropriate exception for file not found errors.#626
Open
creepereye1204 wants to merge 2 commits intotheskumar:mainfrom
Conversation
…r Updated test_main.py (line 351) to replace IOError with FileNotFoundError so that the test matches the updated exception handling in main.py.
…rror with FileNotFoundError on line 377 of main.py to use a more specific and appropriate exception for file not found errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Improve error handling and remove unused parameter in
main.pyDescription
This pull request introduces two refactoring changes to
main.pyaimed at improving code clarity and maintainability.Changes
Use specific exception for file not found
Replace raising a general
IOErrorwith the more specificFileNotFoundErrorwhen a dotenv file is not found. This provides clearer error information and enables more precise exception handling by callers.Before (approx. line 377):
After:
Remove unused parameter in
main.pyRemove the unused parameter to reduce confusion and improve function signatures. (Include the exact parameter name and small code diff in the commit if needed.)
Tests updated
Update tests to expect the new exception type. In
tests/test_main.pyat line 349, change the assertion from expectingIOErrorto expectingFileNotFoundError.Before:
After: