Improvement #12559
openProvide better information/details in error log when a PolicyManagementException occured
0%
Description
Currently, when a PolicyManagementException coocured it does not provide more information on the issue [1].
for example, it says "Device details cannot be null", but doenst say what are the devices(IDs).
Improve the error log to provide additional information on the issue.
[1]
TID: [] [] [2025-02-10 05:58:26,634] ERROR {io.entgra.device.mgt.core.policy.decision.point.simple.SimpleEvaluationImpl} - Error occurred when retrieving the policy related data from policy management service. io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException: Device details cannot be null.
at io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyInformationPointImpl.getDeviceData(PolicyInformationPointImpl.java:85)
at io.entgra.device.mgt.core.policy.decision.point.simple.SimpleEvaluationImpl.getEffectivePolicy(SimpleEvaluationImpl.java:50)
at io.entgra.device.mgt.core.policy.decision.point.simple.PolicyEvaluationServiceImpl.getEffectivePolicy(PolicyEvaluationServiceImpl.java:40)
at io.entgra.device.mgt.core.policy.mgt.core.enforcement.PolicyEnforcementDelegatorImpl.getEffectivePolicy(PolicyEnforcementDelegatorImpl.java:102)
at io.entgra.device.mgt.core.policy.mgt.core.enforcement.PolicyEnforcementDelegatorImpl.delegate(PolicyEnforcementDelegatorImpl.java:72)
at io.entgra.device.mgt.core.policy.mgt.core.enforcement.DelegationTask.executeDynamicTask(DelegationTask.java:86)
at io.entgra.device.mgt.core.device.mgt.core.task.impl.DynamicPartitionedScheduleTask.execute(DynamicPartitionedScheduleTask.java:99)
at org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
No data to display