Skip to content

Commit

Permalink
Include exception message for "Source forest creation failed" error
Browse files Browse the repository at this point in the history
We experienced this error from integration tests which failed to clean up after themselves and left write-protected files behind. This is just a small messaging improvement which would have made finding the root cause easier.

The change here is analogous to this error: https://github.com/bazelbuild/bazel/blob/d1820a75ea3eb182ef2c2319bb77be19c4113a47/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java#L875

Closes bazelbuild#16071.

PiperOrigin-RevId: 469754461
Change-Id: I23649844178f6c5b4c2c016903289ac043f2c230
  • Loading branch information
kmicklas authored and aiuto committed Oct 12, 2022
1 parent c32ed4c commit 55af3fe
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,11 @@ private void prepare(PackageRoots packageRoots) throws AbruptExitException, Inte
request.getOptions(BuildLanguageOptions.class).experimentalSiblingRepositoryLayout);
symlinkForest.plantSymlinkForest();
} catch (IOException e) {
String message = String.format("Source forest creation failed: %s", e.getMessage());
throw new AbruptExitException(
DetailedExitCode.of(
FailureDetail.newBuilder()
.setMessage("Source forest creation failed")
.setMessage(message)
.setSymlinkForest(
FailureDetails.SymlinkForest.newBuilder()
.setCode(FailureDetails.SymlinkForest.Code.CREATION_FAILED))
Expand Down

0 comments on commit 55af3fe

Please sign in to comment.