Either log or rethrow this exception due to multiple exceptions?

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());
    }

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

Missed that, thanks very much!!!