Skip to content

Commit 128f7c6

Browse files
authored
fix: improve error message when an invalid label or a file that is not a directory is passed to directory_path (#127)
1 parent 9162a3f commit 128f7c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/directory_path.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DirectoryPathInfo = provider(
1414

1515
def _directory_path(ctx):
1616
if not ctx.file.directory.is_directory:
17-
fail("directory attribute must be created with Bazel declare_directory (TreeArtifact)")
17+
fail("expected directory to be a TreeArtifact (ctx.actions.declare_directory) but got {}".format(ctx.file.directory))
1818
return [DirectoryPathInfo(path = ctx.attr.path, directory = ctx.file.directory)]
1919

2020
directory_path = rule(

0 commit comments

Comments
 (0)