Skip to content

patches/0004: match JavaIoFileSystem error contract in WindowsFileSys… - #14

Merged
Ilia (k15tfu) merged 1 commit into
masterfrom
mf/fix-exceptions
May 5, 2026
Merged

Ilia (k15tfu) merged 1 commit into
masterfrom
mf/fix-exceptions

Conversation

@mfilippov

Copy link
Copy Markdown
Collaborator

…tem#readdir

Files.walkFileTree throws java.nio.file.NoSuchFileException when the path is missing, but RemoteActionFileSystem.getDirectoryContents only catches java.io.FileNotFoundException — the NIO exception slipped past and broke validation of disk-cache-restored tree artifacts in BwoB mode (e.g. "error while validating output tree artifact ...: .../META-INF").

Translate NIO exceptions inside readdir to match the base JavaIoFileSystem.getDirectoryEntries contract:

  • NoSuchFileException -> FileNotFoundException(path + " (No such file or directory)")
  • NotDirectoryException -> IOException(path + " (Not a directory)")

Also guard the visitor: walkFileTree(maxDepth=1) calls visitFile on the start path when it isn't a directory, so detect that and surface a NotDirectoryException there too.

…tem#readdir

Files.walkFileTree throws java.nio.file.NoSuchFileException when the
path is missing, but RemoteActionFileSystem.getDirectoryContents only
catches java.io.FileNotFoundException — the NIO exception slipped past
and broke validation of disk-cache-restored tree artifacts in BwoB
mode (e.g. "error while validating output tree artifact ...: \.../META-INF").

Translate NIO exceptions inside readdir to match the base
JavaIoFileSystem.getDirectoryEntries contract:
  - NoSuchFileException     -> FileNotFoundException(path + " (No such file or directory)")
  - NotDirectoryException   -> IOException(path + " (Not a directory)")

Also guard the visitor: walkFileTree(maxDepth=1) calls visitFile on the
start path when it isn't a directory, so detect that and surface a
NotDirectoryException there too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@k15tfu
Ilia (k15tfu) merged commit 996316f into master May 5, 2026
14 checks passed
@k15tfu
Ilia (k15tfu) deleted the mf/fix-exceptions branch May 5, 2026 21:01
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.

2 participants