Commit ae13a5a370c1069a6476eaa75cb42538e8528a6f
Committed by
GitHub
Merge pull request #1110 from thingsboard/typo-fix
Fixed exception msg
Showing
2 changed files
with
4 additions
and
2 deletions
@@ -54,6 +54,7 @@ import java.util.ArrayList; | @@ -54,6 +54,7 @@ import java.util.ArrayList; | ||
54 | import java.util.Collections; | 54 | import java.util.Collections; |
55 | import java.util.Comparator; | 55 | import java.util.Comparator; |
56 | import java.util.List; | 56 | import java.util.List; |
57 | +import java.util.concurrent.ExecutionException; | ||
57 | import java.util.stream.Collectors; | 58 | import java.util.stream.Collectors; |
58 | 59 | ||
59 | import static org.thingsboard.server.common.data.CacheConstants.ASSET_CACHE; | 60 | import static org.thingsboard.server.common.data.CacheConstants.ASSET_CACHE; |
@@ -141,7 +142,7 @@ public class BaseAssetService extends AbstractEntityService implements AssetServ | @@ -141,7 +142,7 @@ public class BaseAssetService extends AbstractEntityService implements AssetServ | ||
141 | if (entityViews != null && !entityViews.isEmpty()) { | 142 | if (entityViews != null && !entityViews.isEmpty()) { |
142 | throw new DataValidationException("Can't delete asset that is assigned to entity views!"); | 143 | throw new DataValidationException("Can't delete asset that is assigned to entity views!"); |
143 | } | 144 | } |
144 | - } catch (Exception e) { | 145 | + } catch (ExecutionException | InterruptedException e) { |
145 | log.error("Exception while finding entity views for assetId [{}]", assetId, e); | 146 | log.error("Exception while finding entity views for assetId [{}]", assetId, e); |
146 | throw new RuntimeException("Exception while finding entity views for assetId [" + assetId + "]", e); | 147 | throw new RuntimeException("Exception while finding entity views for assetId [" + assetId + "]", e); |
147 | } | 148 | } |
@@ -58,6 +58,7 @@ import java.util.Collections; | @@ -58,6 +58,7 @@ import java.util.Collections; | ||
58 | import java.util.Comparator; | 58 | import java.util.Comparator; |
59 | import java.util.List; | 59 | import java.util.List; |
60 | import java.util.Optional; | 60 | import java.util.Optional; |
61 | +import java.util.concurrent.ExecutionException; | ||
61 | import java.util.stream.Collectors; | 62 | import java.util.stream.Collectors; |
62 | 63 | ||
63 | import static org.thingsboard.server.common.data.CacheConstants.DEVICE_CACHE; | 64 | import static org.thingsboard.server.common.data.CacheConstants.DEVICE_CACHE; |
@@ -158,7 +159,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe | @@ -158,7 +159,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe | ||
158 | if (entityViews != null && !entityViews.isEmpty()) { | 159 | if (entityViews != null && !entityViews.isEmpty()) { |
159 | throw new DataValidationException("Can't delete device that is assigned to entity views!"); | 160 | throw new DataValidationException("Can't delete device that is assigned to entity views!"); |
160 | } | 161 | } |
161 | - } catch (Exception e) { | 162 | + } catch (ExecutionException | InterruptedException e) { |
162 | log.error("Exception while finding entity views for deviceId [{}]", deviceId, e); | 163 | log.error("Exception while finding entity views for deviceId [{}]", deviceId, e); |
163 | throw new RuntimeException("Exception while finding entity views for deviceId [" + deviceId + "]", e); | 164 | throw new RuntimeException("Exception while finding entity views for deviceId [" + deviceId + "]", e); |
164 | } | 165 | } |