gnodet-bot commented on code in PR #28683:
URL: https://github.com/apache/camel/pull/28683#discussion_r4413042924


##########
core/camel-console/src/main/java/org/apache/camel/impl/console/EvalLanguageDevConsole.java:
##########
@@ -90,7 +97,7 @@ protected String doCallText(Map<String, Object> options) {
                 Predicate pre = 
getCamelContext().resolveLanguage(language).createPredicate(template);
                 out = pre.matches(dummy) ? "true" : "false";
             } else {
-                Expression exp = 
getCamelContext().resolveLanguage(language).createExpression(template);
+                Expression exp = createExpression(language, template, options);

Review Comment:
   ⚠️ **Bug:** `createExpression()` throws `IllegalArgumentException` when 
`resultType` is not on the classpath, but `doCallText()` has no surrounding 
try-catch — the exception propagates uncaught. `doCallJson()` is protected by 
its `catch (Exception e)` block; `doCallText()` is not. A `camel cmd eval` call 
over the text path with an unknown `resultType` will blow up instead of 
printing an error.
   
   Wrap the entire `if (template != null)` body in `doCallText()` with 
try-catch, returning the error message as plain text, consistent with what 
`doCallJson()` does.



-- 
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