Skip to content

Commit

Permalink
Improve usefulness of NotASymlinkException#getMessage. Note that the …
Browse files Browse the repository at this point in the history
…returned string can make its way into Bazel's printed error message.

RELNOTES: None
PiperOrigin-RevId: 240779338
  • Loading branch information
haxorz authored and copybara-github committed Mar 28, 2019
1 parent 18ef7a5 commit d4f51b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public DigestHashFunction getDigestFunction() {
*/
protected static final class NotASymlinkException extends IOException {
public NotASymlinkException(Path path) {
super(path.toString());
super(path + " is not a symlink");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void testReadSymbolicLink() throws IOException {
xFile.readSymbolicLink(); // not a link
fail();
} catch (NotASymlinkException e) {
assertThat(e).hasMessageThat().isEqualTo(xFile.toString());
assertThat(e).hasMessageThat().isEqualTo(xFile.toString() + " is not a symlink");
}

try {
Expand Down

0 comments on commit d4f51b9

Please sign in to comment.