boardtc
(Tom Corcoran)
November 15, 2023, 4:54pm
1
Why am I getting the Either log or rethrow this exception error when I have logged it? Is it because of the multiple exceptions? Any way of getting past this?
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ex) {
LOGGER.debug("Could not find Class: {}", myClass.getSimpleName());
}
Rebse
(Gilbert Rebhan)
November 16, 2023, 7:30am
2
Hi,
it’s because you don’t log the exception, see rule description
Why is this an issue?
When handling a caught exception, the original exception’s message and stack trace should be logged or passed forward.
According to the rule description the NoSuchMethod exception is excluded, but you have
also other exceptions in your try statement.
Gilbert
1 Like
boardtc
(Tom Corcoran)
November 16, 2023, 11:46am
3
Missed that, thanks very much!!!