change exception texts
This commit is contained in:
parent
892cc1a907
commit
0a57fc78dd
@ -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();
|
||||
}
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user