ソースを参照

下发离线异常修改

xiwa 3 年 前
コミット
342ca153ef

+ 3 - 2
manager/src/main/java/cc/iotkit/manager/service/DeviceService.java

@@ -2,6 +2,7 @@ package cc.iotkit.manager.service;
 
 import cc.iotkit.common.exception.BizException;
 import cc.iotkit.common.exception.NotFoundException;
+import cc.iotkit.common.exception.OfflineException;
 import cc.iotkit.common.utils.UniqueIdUtil;
 import cc.iotkit.comps.ComponentManager;
 import cc.iotkit.converter.ThingService;
@@ -41,7 +42,7 @@ public class DeviceService {
             dataOwnerService.checkOwner(device);
         }
         if (!device.getState().isOnline()) {
-            throw new BizException("device is offline");
+            throw new OfflineException("device is offline");
         }
 
         ThingService<?> thingService = ThingService.builder()
@@ -71,7 +72,7 @@ public class DeviceService {
             dataOwnerService.checkOwner(device);
         }
         if (!device.getState().isOnline()) {
-            throw new BizException("device is offline");
+            throw new OfflineException("device is offline");
         }
 
         ThingService<?> thingService = ThingService.builder()