Skip to content

Commit

Permalink
Show a better error when MODULE.bazel is missing
Browse files Browse the repository at this point in the history
Previously, Bazel would error out with this message if it couldn't find
a MODULE.bazel (e.g. in the root module):

```
ERROR: unknown error during computation of main repo mapping
```

Closes #16080.

PiperOrigin-RevId: 466910762
Change-Id: I6fe4fc3e26b5fd203945d7031a9b2a086dce4d31
  • Loading branch information
fmeum authored and copybara-github committed Aug 11, 2022
1 parent 3380d9f commit d4f2da5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private static byte[] readFile(Path path) throws ModuleFileFunctionException {
try {
return FileSystemUtils.readWithKnownFileSize(path, path.getFileSize());
} catch (IOException e) {
throw new ModuleFileFunctionException(e);
throw errorf(Code.MODULE_NOT_FOUND, "MODULE.bazel expected but not found at %s", path);
}
}

Expand Down

0 comments on commit d4f2da5

Please sign in to comment.