Implement Assertions for TaskManager File Handling#1
Merged
Conversation
Refactor file handling in TaskManager to improve reliability. The TaskManager class handles file operations for loading and saving tasks. Previously, the file creation and directory handling lacked robust error checking. This refactor includes: * Adding assertions for directory and file creation * Verifying lines read from the file are non-null and non-empty * Ensuring tasks are not null before saving This enhances reliability and helps catch issues early in development.
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.
This PR introduces assertions into the
TaskManagerclass to enhance the reliability of file handling operations.The previous implementation lacked robust error checking, which could lead to runtime issues if files or directories were not created properly. Adding these assertions helps catch issues early and ensures that file operations are handled correctly.
This refactor improves the robustness of file handling in the
TaskManagerclass and helps in identifying and debugging issues related to file operations.Ensure that all file-related operations are tested to verify that the assertions are correctly triggered in case of failures.