Browse Source

change exception texts

pull/7974/head
Yuriy Lytvynchuk 4 years ago
parent
commit
0a57fc78dd
  1. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/filter/TbAssetTypeSwitchNode.java
  2. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/filter/TbDeviceTypeSwitchNode.java

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/filter/TbAssetTypeSwitchNode.java

@ -40,11 +40,11 @@ public class TbAssetTypeSwitchNode extends TbAbstractTypeSwitchNode {
protected String getRelationType(TbContext ctx, EntityId originator) {
if (!EntityType.ASSET.equals(originator.getEntityType())) {
throw new RuntimeException("Unsupported originator type: " + originator.getEntityType() + "!");
throw new RuntimeException("Unsupported originator type: " + originator.getEntityType() + "! Only 'ASSET' type is allowed.");
}
AssetProfile assetProfile = ctx.getAssetProfileCache().get(ctx.getTenantId(), (AssetId) originator);
if (assetProfile == null) {
throw new RuntimeException("Asset profile with entity id: " + originator.getId() + " wasn't found!");
throw new RuntimeException("Asset profile for entity id: " + originator.getId() + " wasn't found!");
}
return assetProfile.getName();
}

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/filter/TbDeviceTypeSwitchNode.java

@ -40,11 +40,11 @@ public class TbDeviceTypeSwitchNode extends TbAbstractTypeSwitchNode {
protected String getRelationType(TbContext ctx, EntityId originator) {
if (!EntityType.DEVICE.equals(originator.getEntityType())) {
throw new RuntimeException("Unsupported originator type: " + originator.getEntityType() + "!");
throw new RuntimeException("Unsupported originator type: " + originator.getEntityType() + "! Only 'DEVICE' type is allowed.");
}
DeviceProfile deviceProfile = ctx.getDeviceProfileCache().get(ctx.getTenantId(), (DeviceId) originator);
if (deviceProfile == null) {
throw new RuntimeException("Device profile with entity id: " + originator.getId() + " wasn't found!");
throw new RuntimeException("Device profile for entity id: " + originator.getId() + " wasn't found!");
}
return deviceProfile.getName();
}

Loading…
Cancel
Save