When registering JMX with a wildcard, getting an MBeanRuntimeException is managed and allows to consider the metric attribute as having a transient error.
However this is not the case when not using wildcards, which makes it fail for example when the implementation throws an MbeanRuntimeException with NullPointerException as cause.
This PR just applies the same heuristics for both cases with a minor refactor to prevent this from happening in the future.
What does this PR do?
When registering JMX with a wildcard, getting an
MBeanRuntimeException
is managed and allows to consider the metric attribute as having a transient error.However this is not the case when not using wildcards, which makes it fail for example when the implementation throws an
MbeanRuntimeException
withNullPointerException
as cause.This PR just applies the same heuristics for both cases with a minor refactor to prevent this from happening in the future.
Checklist