Conversation
|
CI note: the three
|
|
Please rebase on current main |
Closes pimutils#720. A locked status database surfaced as a bare traceback under the generic error handler. Catch the sqlite3 OperationalError and print an actionable message; re-raise any other OperationalError unchanged.
364f541 to
4c2cef1
Compare
|
Rebased on current |
ruff BLE001 (blind except BaseException) was failing the sr.ht tests-pypi check job. The tests only ever raise sqlite3.OperationalError, so catch exactly that.
|
Rebased on current |
Closes #720.
What
When the sqlite status database is locked (another vdirsyncer process running,
or a previous run interrupted),
vdirsyncer syncprinted a bare "Unknown erroroccurred … Use
-vdebugto see the full traceback." That's what the issue askedto improve.
Fix
handle_cli_errornow catchessqlite3.OperationalError. If the message isdatabase is locked, it prints an actionable hint (make sure no othervdirsyncer process is running; delete the
.itemsfile for the collection as alast resort). Any other
OperationalErroris re-raised so it still reaches thegeneric handler unchanged.
Tests
Added to
tests/system/cli/test_utils.py, mirroring the existingtest_handle_cli_error:test_handle_cli_error_database_locked— asserts the friendly message and notraceback.
test_handle_cli_error_other_operational_error— asserts an unrelatedOperationalErroris re-raised.Validation
RED→GREEN: with the source fix reverted (tests kept), both new tests fail
(
assert 'status database is locked' in …fails;DID NOT RAISE OperationalError); with the fix, all pass.ruff format --checkclean on both files. Happy to adjust the wording.