Skip to content

Commit

Permalink
refactor: provide context in runtime error
Browse files Browse the repository at this point in the history
Signed-off-by: Jude Niroshan <jude.niroshan11@gmail.com>
  • Loading branch information
JudeNiroshan committed May 9, 2024
1 parent b7b2a3a commit d34f4a5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ List<PythonDependency> getDependencyTreeJsonFromPipDepTree() {
return mapToPythonDependencies(pipdeptreeJsonString);
}

public static List<PythonDependency> mapToPythonDependencies(String jsonString) {
List<PythonDependency> mapToPythonDependencies(String jsonString) {
try {
// Parse JSON and store in a list of JsonNodes
List<JsonNode> jsonNodeList = new ArrayList<>();
Expand All @@ -384,7 +384,8 @@ public static List<PythonDependency> mapToPythonDependencies(String jsonString)
})
.collect(Collectors.toList());
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
throw new RuntimeException(
"Could not parse the JSON output from 'pipdeptree --json' command. ", e);
}
}

Expand Down

0 comments on commit d34f4a5

Please sign in to comment.