Skip to content

Commit

Permalink
Add exception message to 'failed to create output directory'
Browse files Browse the repository at this point in the history
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 bazelbuild#17951.

PiperOrigin-RevId: 523461253
Change-Id: I96e434d0934c26ecc696cf386362ee17a6588cc5
  • Loading branch information
EdSchouten authored and copybara-github committed Apr 11, 2023
1 parent 89a3d5e commit 27e4c62
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 27e4c62

Please sign in to comment.