From 27e4c6243524156d880bd04e834db5ebdb0a69af Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 11 Apr 2023 11:44:26 -0700 Subject: [PATCH] Add exception message to 'failed to create output directory' It looks like all of the similar code paths in this file properly attach the exception message to the error message, while this one does not. Omitting the message makes it hard to figure out the root cause. While there, make a minor error message string formatting improvement. Closes #17951. PiperOrigin-RevId: 523461253 Change-Id: I96e434d0934c26ecc696cf386362ee17a6588cc5 --- .../devtools/build/lib/skyframe/SkyframeActionExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java index 1560bf0f7a06b4..049d1b172117d8 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java @@ -1304,7 +1304,8 @@ private void createActionFsOutputDirectories( action.getOutputs(), artifactPathResolver); } catch (CreateOutputDirectoryException e) { throw toActionExecutionException( - String.format("failed to create output directory '%s'", e.directoryPath), + String.format( + "failed to create output directory '%s': %s", e.directoryPath, e.getMessage()), e, action, null, @@ -1346,7 +1347,7 @@ private static void setupActionFsFileOutErr(FileOutErr fileOutErr, Action action } catch (IOException e) { String message = String.format( - "failed to create output directory for output streams'%s': %s", + "failed to create output directory for output streams '%s': %s", fileOutErr.getErrorPath(), e.getMessage()); DetailedExitCode code = createDetailedExitCode(message, Code.ACTION_FS_OUT_ERR_DIRECTORY_CREATION_FAILURE);