Skip to content

fix(Vfs): return not found for a path that runs through a file - #134

Merged
lmichaelis merged 1 commit into
GothicKit:mainfrom
Reveares:fix/resolve-through-file
Nov 15, 2026
Merged

lmichaelis merged 1 commit into
GothicKit:mainfrom
Reveares:fix/resolve-through-file

Conversation

@Reveares

@Reveares Reveares commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Vfs::resolve called VfsNode::child on every node it walked through. On a file node that throws std::bad_variant_access the process terminates due the noexcept.

Now, for a path whose middle segment is a file:

  • resolve returns nullptr
  • remove returns false
  • mount / mount_host throw VfsNotFoundError

Question
mkdir throws VfsFileExistsError for this kind of path, while mount now throws VfsNotFoundError, as its docs say for a missing parent.
Should they agree?

Vfs::resolve called VfsNode::child on a file and terminated the process; Vfs::remove, mount and mount_host inherited it.
@lmichaelis lmichaelis self-assigned this Nov 15, 2026
@lmichaelis lmichaelis added the bug Something isn't working label Nov 15, 2026
@lmichaelis

Copy link
Copy Markdown
Member

Hiya, thank you for this contribution! I've got no additional comments to make, everything is clean. A very nice first contribution :)

As for your question: I think making the distinction between "file not found" and "file already exists" is useful in general though maybe a more generic VfsInvalidPath or VfsNotADirectory base exception could also be useful.

@lmichaelis
lmichaelis merged commit 1943eb3 into GothicKit:main Nov 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants