Skip to content

Commit

Permalink
Also show details for singular MavenDownloadingException (#4486)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Sep 12, 2024
1 parent 50cb39c commit 3e694bb
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Stream<SourceFile> parseInputs(Iterable<Input> sources, @Nullable Path re
Pom pom = RawPom.parse(source.getSource(ctx), null)
.toPom(pomPath, null);

if (pom.getProperties() == null || pom.getProperties().isEmpty()) {
if (pom.getProperties().isEmpty()) {
pom = pom.withProperties(new LinkedHashMap<>());
}
String baseDir = pomPath.toAbsolutePath().getParent().toString();
Expand Down Expand Up @@ -117,15 +117,14 @@ public Stream<SourceFile> parseInputs(Iterable<Input> sources, @Nullable Path re
}
parsed.add(docToPom.getKey().withMarkers(docToPom.getKey().getMarkers().compute(model, (old, n) -> n)));
} catch (MavenDownloadingExceptions e) {
ParseExceptionResult parseExceptionResult = new ParseExceptionResult(
randomId(),
MavenParser.class.getSimpleName(),
e.getClass().getSimpleName(),
e.warn(docToPom.getKey()).printAll(), // Shows any underlying MavenDownloadingException
null);
parsed.add(docToPom.getKey().withMarkers(docToPom.getKey().getMarkers().add(parseExceptionResult)));
String message = e.warn(docToPom.getKey()).printAll(); // Shows any underlying MavenDownloadingException
parsed.add(docToPom.getKey().withMarkers(docToPom.getKey().getMarkers().add(ParseExceptionResult.build(this, e, message))));
ctx.getOnError().accept(e);
} catch (MavenDownloadingException | UncheckedIOException e) {
} catch (MavenDownloadingException e) {
String message = e.warn(docToPom.getKey()).printAll(); // Shows any underlying MavenDownloadingException
parsed.add(docToPom.getKey().withMarkers(docToPom.getKey().getMarkers().add(ParseExceptionResult.build(this, e, message))));
ctx.getOnError().accept(e);
} catch (UncheckedIOException e) {
parsed.add(docToPom.getKey().withMarkers(docToPom.getKey().getMarkers().add(ParseExceptionResult.build(this, e))));
ctx.getOnError().accept(e);
}
Expand Down

0 comments on commit 3e694bb

Please sign in to comment.