davidradl commented on code in PR #969:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/969#discussion_r2077809448


##########
flink-kubernetes-operator-api/src/main/java/org/apache/flink/kubernetes/operator/api/utils/SpecUtils.java:
##########
@@ -99,6 +99,28 @@ public static String writeSpecWithMeta(
         }
     }
 
+    public static String serializeObject(Object object, String wrapperKey) {
+        ObjectNode wrapper = objectMapper.createObjectNode();
+        wrapper.set(wrapperKey, 
objectMapper.valueToTree(checkNotNull(object)));
+
+        try {
+            return objectMapper.writeValueAsString(wrapper);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(
+                    "Could not serialize " + wrapperKey + ", this indicates a 
bug...", e);

Review Comment:
   nit: should be include object.toString() in the error also?



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to