elharo opened a new issue, #12611:
URL: https://github.com/apache/maven/issues/12611
# DefaultModelBuilder: Rethrows wrong exception in XmlReaderException catch
**Found in:** maven-4.0.x branch
**File:**
`impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java`
(lines 1576-1583)
**Severity:** Low
## Description
In the nested catch block where strict=false also fails to read the XML, the
code rethrows the original exception `e` rather than the non-strict exception
`ne`:
```java
} catch (XmlReaderException ne) {
// still unreadable even in non-strict mode, rethrow original error
throw e; // rethrows the original `e`, not `ne`
}
```
This means the exception thrown doesn't reflect the actual cause of the
final failure (the non-strict read attempt). The exception message and stack
trace from the rethrown exception match the original strict-mode failure, not
the actual final attempt.
--
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]