From a94bfc69409e8e7045a6b66132304734ea83d557 Mon Sep 17 00:00:00 2001 From: Deenath Geegange Date: Thu, 24 Nov 2022 19:15:38 +0530 Subject: [PATCH] forwaded traccer device not present to addDevice --- .../core/traccar/api/service/TraccarClientFactory.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java index 1175b80f24..2bdc05ad24 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java @@ -509,9 +509,12 @@ public class TraccarClientFactory { } }else { // forward to add device - String msg = "Tracker device for device id " + traccarDevice.getId() + " not found in local database"; - log.error(msg); - throw new TrackerManagementDAOException(msg); + try { + addDevice(traccarDevice,tenantId); + } catch (TrackerAlreadyExistException e) { + String msg = "The device already exist"; + log.error(msg, e); + } } }