Handle permission denied errors gracefully#52
Open
nealmcb wants to merge 1 commit into
Open
Conversation
When syncing Android storage, permission denied errors are common when accessing app-specific directories like Android/data/*/. Previously these errors would trigger a fatal error and crash the sync process. This change: 1. Adds proper detection of "Permission denied" errors via regex pattern matching 2. Handles these errors gracefully by: - Logging warnings when permission errors occur - Skipping inaccessible paths instead of crashing - Continuing the sync process for accessible files/directories 3. Adds more detailed error logging to help diagnose issues The approach handles permissions at the filesystem level rather than adding a new CLI flag. This maintains the existing interface while making the tool more robust against common Android permission restrictions. Fixes jb2170#11
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.
When syncing Android storage, permission denied errors are common when accessing app-specific directories like Android/data/*/. Previously these errors would trigger a fatal error and crash the sync process.
This change:
The approach handles permissions at the filesystem level rather than adding a new CLI flag. This maintains the existing interface while making the tool more robust against common Android permission restrictions.
Thanks to @Sebbb for #27 and related work on the same problem, and thanks to Cursor for this particular approach based on these issues.
Fixes #11