Skip to content

Commit

Permalink
Report a specific error when a Fileset is asked to traverse a source …
Browse files Browse the repository at this point in the history
…directory.

PiperOrigin-RevId: 718831321
Change-Id: I6dc658fc1df481df4f04bd021f4df30c32939fe9
  • Loading branch information
c-mita authored and copybara-github committed Jan 23, 2025
1 parent 9b3b15d commit 7d673a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ private SkyValue createSourceValue(Artifact artifact, Environment env)
case DANGLING_SYMLINK:
case FILE_OPERATION_FAILURE:
case SYMLINK_CYCLE_OR_INFINITE_EXPANSION:
case CANNOT_TRAVERSE_SOURCE_DIRECTORY:
throw new ArtifactFunctionException(
SourceArtifactException.create(artifact, e), Transience.PERSISTENT);
case INCONSISTENT_FILESYSTEM:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public SkyValue compute(SkyKey key, Environment env)
String.format(
"%s contains a directory artifact '%s'",
params.getOwnerLabelForErrorMessages(), params.getDestPath()),
RecursiveFilesystemTraversalException.Type.FILE_OPERATION_FAILURE));
RecursiveFilesystemTraversalException.Type.CANNOT_TRAVERSE_SOURCE_DIRECTORY));
}

// The "direct" traversal params are present, which is the case when the FilesetEntry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public enum Type {

/** The filesystem threw a {@link DetailedIOException}. */
DETAILED_IO_EXCEPTION,

/** A traversal of a source directory was requested. */
CANNOT_TRAVERSE_SOURCE_DIRECTORY,
}

private final RecursiveFilesystemTraversalException.Type type;
Expand Down

0 comments on commit 7d673a1

Please sign in to comment.