Skip to content

fix: propagate errors from asset modification date lookup - #17

Merged
julianschiavo merged 1 commit into
mainfrom
fix/asset-locator-modification-date
Mar 13, 2026
Merged

fix: propagate errors from asset modification date lookup#17
julianschiavo merged 1 commit into
mainfrom
fix/asset-locator-modification-date

Conversation

@julianschiavo

@julianschiavo julianschiavo commented Mar 13, 2026

Copy link
Copy Markdown
Member
  • Change modificationDate(for:) from silently returning .distantPast on failure to throwing, so callers surface the real error instead of mis-sorting assets
  • Update the sort closure in locateDatabaseDirectoryURL() to propagate the throwing call
  • Add regression test verifying modificationDate throws for a nonexistent URL

Note

Low Risk
Low risk: small change to error propagation during asset selection plus a regression test; behavior only changes when modification date lookup fails (now throws instead of silently sorting as oldest).

Overview
Fixes asset selection error handling by making DocumentationAssetLocator.modificationDate(for:) throw on lookup failures instead of defaulting to .distantPast, and updating the candidate sort in locateDatabaseDirectoryURL() to propagate that error.

Adds a test ensuring a nonexistent asset URL causes modificationDate(for:) to throw, preventing silent mis-sorting of assets.

Written by Cursor Bugbot for commit 90dc687. This will update automatically on new commits. Configure here.

@julianschiavo
julianschiavo merged commit 83e2865 into main Mar 13, 2026
3 checks passed
@julianschiavo
julianschiavo deleted the fix/asset-locator-modification-date branch March 13, 2026 05:58
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.

1 participant