gnodet commented on code in PR #1185:
URL: https://github.com/apache/maven/pull/1185#discussion_r1245404521
##########
maven-model-builder/src/main/java/org/apache/maven/model/io/DefaultModelReader.java:
##########
@@ -120,23 +120,29 @@ private Model read(Reader reader, Path pomFile,
Map<String, ?> options) throws I
} else {
return readModel(transformingParser, strict);
}
- } catch (XmlPullParserException e) {
- throw new ModelParseException(e.getMessage(), e.getLineNumber(),
e.getColumnNumber(), e);
+ } catch (XMLStreamException e) {
+ Location location = e.getLocation();
+ throw new ModelParseException(
+ e.getMessage(),
+ location != null ? location.getLineNumber() : -1,
+ location != null ? location.getColumnNumber() : -1,
+ e);
} catch (IOException e) {
throw e;
} catch (Exception e) {
Review Comment:
The `IOException` can still occur during the call to
`transformer.transform(...)` and we don't want to wrap it in another
`IOException`...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]