-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Catch LinkageError in ThrowableExtendedStackTraceRenderer#loadClass (#4028)
#4049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 Throwable ignored) { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Catching
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I just realized this was @vy's suggestion (#4049 (comment)), so this merits a longer discussion. I think that catching
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is precisely what we do in |
||||||
| // Do nothing | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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="4049" link="https://github.com/apache/logging-log4j2/pull/4049"/> | ||
| <description format="asciidoc">Ensure all `Throwable`s are handled while rendering stack traces</description> | ||
| </entry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put some more thought into this issue, and this particular test feels like an after-thought. Would you mind removing this particular test method, extending
TestFriendlyExceptionwith this patch to contain a stack trace element of a non-existent class, and adaptThrowablePatternConverterTestand its subclasses to make sure they pass, please?