Provide more accurate ExitCode and FailureDetails when an exception is caught during the loading phase.
In each failure instance of PackageFunctionException, a specific FailureDetail code will be used to describe the exception. As the error gets bubbled up, we have to make sure the information is not lost and is properly passed up the call chain.
RELNOTES: None.
PiperOrigin-RevId: 318929283
diff --git a/src/main/java/com/google/devtools/build/lib/packages/BuildFileNotFoundException.java b/src/main/java/com/google/devtools/build/lib/packages/BuildFileNotFoundException.java
index ca4ffed..6283874 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/BuildFileNotFoundException.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/BuildFileNotFoundException.java
@@ -15,7 +15,7 @@
package com.google.devtools.build.lib.packages;
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
-
+import com.google.devtools.build.lib.util.DetailedExitCode;
import java.io.IOException;
/**
@@ -32,4 +32,9 @@
IOException cause) {
super(packageIdentifier, message, cause);
}
+
+ public BuildFileNotFoundException(
+ PackageIdentifier packageIdentifier, String message, DetailedExitCode detailedExitCode) {
+ super(packageIdentifier, message, detailedExitCode);
+ }
}