diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java index 7f3d3cd80..b546b1a37 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java @@ -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)); } } diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java index fd00f3449..c91f1508e 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java @@ -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 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