diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/EvalException.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/EvalException.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/EvalException.java b/src/main/java/com/google/devtools/build/lib/syntax/EvalException.java index 2f7ca84564..97d695f91d 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/EvalException.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/EvalException.java @@ -19,9 +19,7 @@ import com.google.common.base.Throwables; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.util.LoggingUtil; import com.google.devtools.build.lib.util.Preconditions; - import java.util.logging.Level; - import javax.annotation.Nullable; /** @@ -59,6 +57,25 @@ public class EvalException extends Exception { * @param dueToIncompleteAST if the error is caused by a previous error, such as parsing. */ public EvalException(Location location, String message, boolean dueToIncompleteAST) { + this(location, message, dueToIncompleteAST, true); + } + + /** + * Create an EvalException with the option to not fill in the java stack trace. An optimization + * for ReturnException, and potentially others, which aren't exceptional enough to include a + * stack trace. + * + * @param location the location where evaluation/execution failed. + * @param message the error message. + * @param dueToIncompleteAST if the error is caused by a previous error, such as parsing. + * @param fillInJavaStackTrace whether or not to fill in the java stack trace for this exception + */ + EvalException( + Location location, + String message, + boolean dueToIncompleteAST, + boolean fillInJavaStackTrace) { + super(null, null, /*enableSuppression=*/ true, fillInJavaStackTrace); this.location = location; this.message = Preconditions.checkNotNull(message); this.dueToIncompleteAST = dueToIncompleteAST; |