From e4794532730ce1df4072a23f9fd5209bcc2cb3e6 Mon Sep 17 00:00:00 2001 From: ulfjack Date: Fri, 12 Jan 2018 02:11:17 -0800 Subject: 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 --- .../build/lib/skyframe/LocalRepositoryLookupFunction.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunction.java') 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); -- cgit v1.2.3