vy commented on code in PR #2062:
URL: https://github.com/apache/logging-log4j2/pull/2062#discussion_r1415175905
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java:
##########
@@ -146,8 +149,12 @@ public LoggerContext getContext(
if (externalContext != null && ctx.getExternalContext() == null) {
ctx.setExternalContext(externalContext);
}
- if (ctx.getState() == LifeCycle.State.INITIALIZED) {
- startContext(ctx, classLoader);
+ try {
+ if (ctx.getState() == LifeCycle.State.INITIALIZED) {
+ startContext(ctx, classLoader);
+ }
+ } catch (IllegalStateException ex) {
+ return internalContext;
Review Comment:
@rgoers, there are several points introduced in this PR that swallow
exceptions. I would appreciate it if you can reconsider _"Don't we need to
communicate anything to the user at this point?"_ and if not, add some comments
explaining why it is safe to swallow.
--
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]