Skip to content

Add error handling for missing/iCloud files and export logging#7

Open
glenbhermon wants to merge 1 commit intorobbyHuelsi:masterfrom
glenbhermon:master
Open

Add error handling for missing/iCloud files and export logging#7
glenbhermon wants to merge 1 commit intorobbyHuelsi:masterfrom
glenbhermon:master

Conversation

@glenbhermon
Copy link
Copy Markdown

This PR improves the robustness of the exporter: Fixes #6

  1. Prevents Crashes: Wrapped copyfile in a try-except block to handle FileNotFoundError without stopping the script.

  2. 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)

  1. Catalina Support: Verified pathing and logic for macOS 10.15.

  2. 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

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.

FileNotFoundError when memos are stored in iCloud (macOS 10.15)

1 participant