clean up file path messages for better troubleshooting
This commit is contained in:
parent
54eb35fa1a
commit
b0a9bf27ed
|
@ -150,7 +150,7 @@ public class PathBuilder {
|
|||
return;
|
||||
}
|
||||
if (isPathRoot(args[0])) {
|
||||
throw new RuntimeException("First entry cannot be root: " + args[0]);
|
||||
throw new RuntimeException("First entry in file path cannot be root: " + args[0]+", full path = "+String.join(", ", args));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class PathBuilder {
|
|||
return;
|
||||
}
|
||||
if (args[0] == null || Utilities.noString(args[0].trim())) {
|
||||
throw new RuntimeException("First path entry cannot be null or empty");
|
||||
throw new RuntimeException("First entry in file path cannot be null or empty, full path = "+String.join(", ", args));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ class UtilitiesTest {
|
|||
RuntimeException thrown = Assertions.assertThrows(RuntimeException.class, () -> {
|
||||
Utilities.path(pathStrings);
|
||||
});
|
||||
assertTrue(thrown.getMessage().endsWith(pathStrings[0]));
|
||||
assertTrue(thrown.getMessage().endsWith(pathStrings[0]+", full path = "+String.join(", ", pathStrings)));
|
||||
}
|
||||
|
||||
public static Stream<Arguments> macAndLinuxNonFirstElementStartPaths() {
|
||||
|
@ -384,7 +384,7 @@ class UtilitiesTest {
|
|||
RuntimeException thrown = Assertions.assertThrows(RuntimeException.class, () -> {
|
||||
Utilities.path(pathsStrings);
|
||||
});
|
||||
assertEquals("First path entry cannot be null or empty",thrown.getMessage());
|
||||
assertEquals("First entry in file path cannot be null or empty, full path = "+String.join(", ", pathsStrings),thrown.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue