Add error handling for missing/iCloud files and export logging#7
Open
glenbhermon wants to merge 1 commit intorobbyHuelsi:masterfrom
Open
Add error handling for missing/iCloud files and export logging#7glenbhermon wants to merge 1 commit intorobbyHuelsi:masterfrom
glenbhermon wants to merge 1 commit intorobbyHuelsi:masterfrom
Conversation
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 improves the robustness of the exporter: Fixes #6
Prevents Crashes: Wrapped copyfile in a try-except block to handle FileNotFoundError without stopping the script.
Logging: Added a feature that generates a failed_exports.txt log in the export directory, listing all memos that couldn't be copied.
In the updated code, the log entry looks like this. It’s designed to be easily readable (even for someone who isn't technical) so they can identify exactly which recordings to check in their iCloud:
FAILED: 09.06.2024 14:30:15 | Memo: Interview Part 1 | Reason: Audio file not found on disk (likely in iCloud)Catalina Support: Verified pathing and logic for macOS 10.15.
Summary Table: Added a success/failure count at the end of execution.
--- SUMMARY --- Successfully Exported: 1042 Failed/Inconsistent: 12 Log file saved at: /Users/username/Voice Memos Export/failed_exports.txt