fix: Improve DBAccessError messages for permission/directory issues#6579
fix: Improve DBAccessError messages for permission/directory issues#6579snejus merged 2 commits intobeetbox:masterfrom
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
|
I think we already have a PR in progress that tackles this issue: #6294 |
Add changelog entry for PR beetbox#6579, addressing maintainer feedback. Fixes: improve DBAccessError messages for permission/directory issues
|
Thank you for the feedback! I've added the changelog entry for this PR. The entry reads:
Added in commit: |
…ctory issues - Expanded DBAccessError docstring to mention directory missing and file permissions as potential causes - Split the combined if-check into separate if/elif branches with distinct, actionable messages for each SQLite error: - 'unable to open database file' → suggests checking directory exists and is writable - 'attempt to write a readonly database' → suggests checking file/directory permissions Addresses: beetbox#1676
Signed-off-by: Jah-yee <[email protected]>
fad8ea6 to
8ce49d6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6579 +/- ##
==========================================
- Coverage 71.84% 71.84% -0.01%
==========================================
Files 159 159
Lines 20560 20562 +2
Branches 3259 3260 +1
==========================================
Hits 14772 14772
- Misses 5100 5102 +2
Partials 688 688
🚀 New features to boost your workflow:
|
|
Thanks for pointing that out! After reviewing #6294, I see it catches database permission errors at the UI layer in |
snejus
left a comment
There was a problem hiding this comment.
You're right, apologies for my confusion here! And thanks for your contribution!
Good day!
Thank you for maintaining beets!
Summary of Changes
This PR improves the error messages in
DBAccessErrorto help users diagnose database permission issues more easily:Updated
DBAccessErrordocstring — Now mentions directory missing and file permissions as potential causes (not just file deletion).Split error handling — The combined
if ... in (...)check is replaced with separateif/elifbranches, each providing a distinct, actionable message:unable to open database file→ "Check that the parent directory exists and is writable."attempt to write a readonly database→ "Check file permissions: the database file or its directory may not be writable."Issue
Verification
python3 -m py_compile)beets/dbcore/db.pychangedTesting
Manual verification:
Thank you for reviewing this PR!
Warmly,
RoomWithRoof