aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-01-12 02:11:17 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-12 08:19:06 -0800
commite4794532730ce1df4072a23f9fd5209bcc2cb3e6 (patch)
tree8e224d1015b6da30497b3dffe662149ab7ce78aa /src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java
parent3e379d1479b2de6118b16aa33f6b9b6fd4ac6ab0 (diff)
Make FileSymlinkException and InconsistentFSException IOExceptions
Most places handle them the same way as IOException, which seems like a safe default. The places that do care can still throw or catch the more specific type. PiperOrigin-RevId: 181719688
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java
index d1ffe0e4bb..66d4afaee0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java
@@ -98,12 +98,7 @@ public class LocalRepositoryLookupFunction implements SkyFunction {
.getRelativePath()
.getRelative(BuildFileName.WORKSPACE.getFilenameFragment()));
FileValue workspaceFileValue =
- (FileValue)
- env.getValueOrThrow(
- FileValue.key(workspaceRootedFile),
- IOException.class,
- FileSymlinkException.class,
- InconsistentFilesystemException.class);
+ (FileValue) env.getValueOrThrow(FileValue.key(workspaceRootedFile), IOException.class);
if (workspaceFileValue == null) {
return Optional.absent();
}
@@ -112,10 +107,10 @@ public class LocalRepositoryLookupFunction implements SkyFunction {
return Optional.of(false);
}
return Optional.of(workspaceFileValue.exists());
- } catch (IOException e) {
+ } catch (InconsistentFilesystemException e) {
throw new LocalRepositoryLookupFunctionException(
new ErrorDeterminingRepositoryException(
- "IOException while checking if there is a WORKSPACE file in "
+ "InconsistentFilesystemException while checking if there is a WORKSPACE file in "
+ directory.asPath().getPathString(),
e),
Transience.PERSISTENT);
@@ -126,10 +121,10 @@ public class LocalRepositoryLookupFunction implements SkyFunction {
+ directory.asPath().getPathString(),
e),
Transience.PERSISTENT);
- } catch (InconsistentFilesystemException e) {
+ } catch (IOException e) {
throw new LocalRepositoryLookupFunctionException(
new ErrorDeterminingRepositoryException(
- "InconsistentFilesystemException while checking if there is a WORKSPACE file in "
+ "IOException while checking if there is a WORKSPACE file in "
+ directory.asPath().getPathString(),
e),
Transience.PERSISTENT);