vy commented on code in PR #4049:
URL: https://github.com/apache/logging-log4j2/pull/4049#discussion_r2867824448


##########
src/changelog/.2.x.x/4028_fix_catch_LinkageError_in_ThrowableExtendedStackTraceRenderer.xml:
##########
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns="https://logging.apache.org/xml/ns";
+       xsi:schemaLocation="https://logging.apache.org/xml/ns
+       https://logging.apache.org/xml/ns/log4j-changelog-0.xsd";
+       type="fixed">
+    <issue id="4028" 
link="https://github.com/apache/logging-log4j2/issues/4028"/>
+    <description format="asciidoc">Catch `LinkageError` in 
`ThrowableExtendedStackTraceRenderer#loadClass` to prevent 
`NoClassDefFoundError` from breaking logging</description>

Review Comment:
   ```suggestion
       <description format="asciidoc">Ensure all `Throwable`s are handled while 
rendering stack traces</description>
   ```



##########
src/changelog/.2.x.x/4028_fix_catch_LinkageError_in_ThrowableExtendedStackTraceRenderer.xml:
##########
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns="https://logging.apache.org/xml/ns";
+       xsi:schemaLocation="https://logging.apache.org/xml/ns
+       https://logging.apache.org/xml/ns/log4j-changelog-0.xsd";
+       type="fixed">
+    <issue id="4028" 
link="https://github.com/apache/logging-log4j2/issues/4028"/>

Review Comment:
   ```suggestion
       <issue id="4049" 
link="https://github.com/apache/logging-log4j2/pull/4049"/>
   ```



##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/pattern/ThrowableExtendedStackTraceRendererTest.java:
##########


Review Comment:
   Instead of adding a new test file, would you mind extending 
`ThrowablePatternConverterTest.StackTraceTest`, please?



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowableExtendedStackTraceRenderer.java:
##########
@@ -181,7 +181,7 @@ private static Class<?> loadClass(final ClassLoader loader, 
final String classNa
                     if (clazz != null) {
                         return clazz;
                     }
-                } catch (final Exception ignored) {
+                } catch (final Exception | LinkageError ignored) {

Review Comment:
   ```suggestion
                   } catch (final Throwable ignored) {
   ```



-- 
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]

Reply via email to