Skip to content

Commit

Permalink
Create new exception to have clearer stack trace in AbstractAction.de…
Browse files Browse the repository at this point in the history
…leteOutput

RELNOTES: None.
PiperOrigin-RevId: 266888866
  • Loading branch information
hlopko authored and copybara-github committed Sep 3, 2019
1 parent 737a302 commit ce02a4d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ public static void deleteOutput(Path path, @Nullable ArtifactRoot root) throws I
// Handle a couple of scenarios where the output can still be deleted, but make sure we're not
// deleting random files on the filesystem.
if (root == null) {
throw e;
throw new IOException(e);
}
Root outputRoot = root.getRoot();
if (!outputRoot.contains(path)) {
throw e;
throw new IOException(e);
}

Path parentDir = path.getParentDirectory();
Expand All @@ -383,7 +383,7 @@ public static void deleteOutput(Path path, @Nullable ArtifactRoot root) throws I
} else if (path.isDirectory(Symlinks.NOFOLLOW)) {
path.deleteTree();
} else {
throw e;
throw new IOException(e);
}
}
}
Expand Down

0 comments on commit ce02a4d

Please sign in to comment.