-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages where there's an IOException reading a source …
…file: report the final status to the user as coming from an IOException, not a "missing file." We still had the right failure detail, but the error message is misleading. Also print out top-level "missing input" failure messages in keep-going mode, not just no-keep-going. Noticed as part of this that there were no non-test callers of BuildFailedException#getRootCauses(), and got rid of it. Unfortunately, had to do that in this CL, since without the top-level printing in keep-going mode, we actually weren't ever printing those messages in some cases. PiperOrigin-RevId: 363204012
- Loading branch information
1 parent
203a506
commit 8e9d300
Showing
13 changed files
with
292 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/google/devtools/build/lib/actions/InputFileErrorException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2021 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.lib.actions; | ||
|
||
import com.google.devtools.build.lib.util.DetailedExitCode; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Signals that a source file requested by a top-level target (not via an action) was missing or | ||
* that access threw an {@link IOException}. | ||
*/ | ||
public class InputFileErrorException extends BuildFailedException { | ||
public InputFileErrorException(String message, DetailedExitCode detailedExitCode) { | ||
super(message, /*catastrophic=*/ false, /*errorAlreadyShown=*/ true, detailedExitCode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.