davsclaus commented on code in PR #27198:
URL: https://github.com/apache/camel/pull/27198#discussion_r4154679863


##########
core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java:
##########
@@ -138,6 +139,25 @@ protected void startElement(String name) throws 
IOException {
                 }
             }
 
+            @Override
+            protected void doWriteThrowExceptionDefinition(String name, 
ThrowExceptionDefinition def) throws IOException {
+                Exception e = def.getException();
+                String type = def.getExceptionClass() != null
+                        ? def.getExceptionClass().getName() : e != null ? 
e.getClass().getName() : null;
+                if (type == null || def.getExceptionType() != null || 
def.getRef() != null) {
+                    super.doWriteThrowExceptionDefinition(name, def);
+                    return;
+                }
+                // an exception given as a class or an instance, as in 
throwException(new Exception("...")), is
+                // written as its type and message, as the class or instance 
itself cannot be

Review Comment:
   Fixed in af9d1490d170 (also on the 4.22.x backport #27199, 8541a4064687).
   
   _Claude Code on behalf of davsclaus_



##########
core/camel-yaml-io/src/main/java/org/apache/camel/yaml/LwModelToYAMLDumper.java:
##########
@@ -137,6 +138,23 @@ protected void doWriteAttribute(JsonObject jo, String key, 
String value, String
                 super.doWriteAttribute(jo, key, value, defaultValue);
             }
 
+            @Override
+            protected JsonObject 
doWriteThrowExceptionDefinition(ThrowExceptionDefinition def) {
+                JsonObject jo = super.doWriteThrowExceptionDefinition(def);
+                Exception e = def.getException();
+                String type = def.getExceptionClass() != null
+                        ? def.getExceptionClass().getName() : e != null ? 
e.getClass().getName() : null;
+                if (type != null && def.getExceptionType() == null && 
def.getRef() == null) {
+                    // an exception given as a class or an instance, as in 
throwException(new Exception("...")), is
+                    // written as its type and message, as the class or 
instance itself cannot be

Review Comment:
   Fixed in af9d1490d170 (also on the 4.22.x backport #27199, 8541a4064687).
   
   _Claude Code on behalf of davsclaus_



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to