You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/05 13:00:17 UTC

[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5163: add entity-type to message when no UUID is found for a DB ID

GutoVeronezi commented on a change in pull request #5163:
URL: https://github.com/apache/cloudstack/pull/5163#discussion_r663913413



##########
File path: server/src/main/java/com/cloud/uuididentity/UUIDManagerImpl.java
##########
@@ -119,7 +119,9 @@ public boolean IsUuidFormat(String uuid) {
         }
         Identity identity = (Identity) this._entityMgr.findById(entityType, customId);
         if (identity == null) {
-            throw new InvalidParameterValueException("Unable to find UUID for id " + customId);
+            throw new InvalidParameterValueException(String.format("Unable to find UUID for id %s of type %s",

Review comment:
       I would suggest you to use `[]` as var delimiter; IMHO, it is easier to recognize what is a variable and what is fixed in the final message; e.g.:
   
   `String.format("Unable to find UUID for id [%s] of type [%s].",...`

##########
File path: server/src/main/java/com/cloud/uuididentity/UUIDManagerImpl.java
##########
@@ -119,7 +119,9 @@ public boolean IsUuidFormat(String uuid) {
         }
         Identity identity = (Identity) this._entityMgr.findById(entityType, customId);
         if (identity == null) {
-            throw new InvalidParameterValueException("Unable to find UUID for id " + customId);
+            throw new InvalidParameterValueException(String.format("Unable to find UUID for id %s of type %s",
+                                                                   customId,
+                                                                   (entityType == null ? "<unknown type>" ? entityType.getSimpleName())));

Review comment:
       "unknown" sounds good.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org