aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe
diff options
context:
space:
mode:
authorGravatar Mark Schaller <mschaller@google.com>2015-07-09 16:12:57 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-10 17:19:08 +0000
commit491ed5e57521407b03e01a9e097c7dbd8272ff12 (patch)
treecfa1275290c55c61d6ade6e687b592ba84ca0d85 /src/main/java/com/google/devtools/build/lib/skyframe
parent878aa6c66dad51030306f2537c06b076cb69c8ff (diff)
Log error description, not implementation details
RecursiveDirectoryTraversalFunction should provide a description of what went wrong to the user instead of logging class names. -- MOS_MIGRATED_REVID=97878795
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
index eab8d2eb49..edb14c61d8 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
@@ -118,7 +118,7 @@ abstract class RecursiveDirectoryTraversalFunction
fileValue = (FileValue) env.getValueOrThrow(fileKey, InconsistentFilesystemException.class,
FileSymlinkCycleException.class, IOException.class);
} catch (InconsistentFilesystemException | FileSymlinkCycleException | IOException e) {
- return reportErrorAndReturn(FileValue.class.getSimpleName(), e, rootRelativePath,
+ return reportErrorAndReturn("Failed to get information about path", e, rootRelativePath,
env.getListener());
}
if (fileValue == null) {
@@ -141,7 +141,7 @@ abstract class RecursiveDirectoryTraversalFunction
pkgLookupValue = (PackageLookupValue) env.getValueOrThrow(PackageLookupValue.key(packageId),
NoSuchPackageException.class, InconsistentFilesystemException.class);
} catch (NoSuchPackageException | InconsistentFilesystemException e) {
- return reportErrorAndReturn(PackageLookupValue.class.getSimpleName(), e, rootRelativePath,
+ return reportErrorAndReturn("Failed to load package", e, rootRelativePath,
env.getListener());
}
if (pkgLookupValue == null) {
@@ -198,7 +198,7 @@ abstract class RecursiveDirectoryTraversalFunction
InconsistentFilesystemException.class, IOException.class,
FileSymlinkCycleException.class);
} catch (InconsistentFilesystemException | IOException e) {
- return reportErrorAndReturn(DirectoryListingValue.class.getSimpleName(), e, rootRelativePath,
+ return reportErrorAndReturn("Failed to list directory contents", e, rootRelativePath,
env.getListener());
} catch (FileSymlinkCycleException e) {
// DirectoryListingFunction only throws FileSymlinkCycleException when FileFunction throws it,
@@ -263,9 +263,9 @@ abstract class RecursiveDirectoryTraversalFunction
}
// Ignore all errors in traversal and return an empty value.
- private TReturn reportErrorAndReturn(String lookupValueName, Exception e,
+ private TReturn reportErrorAndReturn(String errorPrefix, Exception e,
PathFragment rootRelativePath, EventHandler handler) {
- handler.handle(Event.warn("Error finding " + lookupValueName + " value for " + rootRelativePath
+ handler.handle(Event.warn(errorPrefix + ", for " + rootRelativePath
+ ", skipping: " + e.getMessage()));
return getEmptyReturn();
}