Skip to content

Commit

Permalink
Convert toString() to getMessage() for InvalidGlobPatternException
Browse files Browse the repository at this point in the history
Also changes `PackageFactoryTest#testBadCharacterInGlob(.)` expected error message to reflect the new behavior.

PiperOrigin-RevId: 593865516
Change-Id: Ie99ff88aea6528fb3adc3670af1602ea9a3d6ce4
  • Loading branch information
yuyue730 authored and copybara-github committed Dec 26, 2023
1 parent 743e24b commit 673d4d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class InvalidGlobPatternException extends Exception {
}

@Override
public String toString() {
return String.format("invalid glob pattern '%s': %s", pattern, getMessage());
public String getMessage() {
return String.format("invalid glob pattern '%s': %s", pattern, super.getMessage());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ public void testGlobWithSubdirMatchAndExclusion() throws Exception {
@Test
public void testBadCharacterInGlob() throws Exception {
reporter.removeHandler(failFastHandler);
assertGlobFails("glob(['?'])", "Error in glob: wildcard ? forbidden");
assertGlobFails("glob(['?'])", "Error in glob: invalid glob pattern '?': wildcard ? forbidden");
}

@Test
Expand Down

0 comments on commit 673d4d3

Please sign in to comment.