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


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -924,6 +924,12 @@ private int run() throws Exception {
             return CliExitCode.USAGE;
         }
 
+        if (camelVersion != null && 
!VersionHelper.isCamel4OrNewer(camelVersion)) {
+            printer().printErr("The --camel-version option does not support 
Camel " + camelVersion
+                               + ": the Camel CLI runs Camel 4.0 or newer.");

Review Comment:
   ⚠️ **Misleading error message**: the message says `"The --camel-version 
option does not support Camel X"` but `camelVersion` can also come from `camel 
version set` (stored in user config) or from `application.properties`. A user 
who set the version earlier with `camel version set 3.22.0` and then runs 
`camel run` will see this message and wonder which `--camel-version` option it 
refers to. The upgrade guide explicitly documents this path ("A Camel 3 version 
stored earlier with `camel version set` is refused by `camel run` as well"). 
The `VersionSet.java` message is correctly phrased (`"Camel version X is not 
supported"`); `Run.java` should match.
   
   ```suggestion
               printer().printErr("Camel version " + camelVersion
                                  + " is not supported: the Camel CLI runs 
Camel 4.0 or newer.");
   ```



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