You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/03/21 09:09:48 UTC

[PR] CAMEL-23226: Standardize error output to use printErr() in camel-jbang [camel]

gnodet opened a new pull request, #22163:
URL: https://github.com/apache/camel/pull/22163

   ## Summary
   
   Camel JBang commands used three inconsistent patterns for reporting errors to the user:
   
   1. `printer().printErr()` -- the correct approach, uses the Printer abstraction with `ERROR:` prefix
   2. `printer().println("error message")` / `printer().printf("error message")` -- writes to stdout instead of stderr, no consistent error prefix
   3. `throw new RuntimeException(e)` -- dumps raw stack traces, poor UX for CLI users
   
   This PR standardizes pattern 2 to use `printErr()` instead. All `printer().println()` and `printer().printf()` calls that output error-like messages (not found, cannot, invalid format, etc.) are replaced with `printer().printErr()`.
   
   Pattern 3 (`throw new RuntimeException`) is **not** addressed here -- the cases found are either in internal utility code (CloneNotSupportedException in Row classes, file copy helpers) or inside lambdas where returning an exit code is not possible. Those warrant separate consideration.
   
   ## Affected commands
   
   - **InfraRun** -- service not found messages
   - **InfraLog** -- log not found message
   - **Run** -- working directory creation failure, background mode not supported for Quarkus/Spring Boot
   - **UpdateRun** -- CamelUpdateException and DownloadException handling
   - **ConfigGet** -- key not found
   - **CatalogDoc** -- resource/component/kamelet not found (including "did you mean" suggestions)
   - **CamelSendAction** -- header format validation, connection details read failure
   - **TransformMessageAction** -- header and option format validation
   - **CamelReceiveAction** -- error starting to receive messages
   - **EvalExpressionCommand** -- header format validation
   - **VersionList** -- download error
   - **DependencyRuntime** -- pom.xml not found
   - **PluginDelete** -- plugin not found in configuration
   
   ## Tests
   
   Updated `ConfigGetTest` and `PluginDeleteTest` to expect the `ERROR:` prefix from `printErr()`.


-- 
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@camel.apache.org

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


Re: [PR] CAMEL-23226: Standardize error output to use printErr() in camel-jbang [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #22163:
URL: https://github.com/apache/camel/pull/22163


-- 
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@camel.apache.org

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


Re: [PR] CAMEL-23226: Standardize error output to use printErr() in camel-jbang [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22163:
URL: https://github.com/apache/camel/pull/22163#issuecomment-4102917026

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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@camel.apache.org

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


Re: [PR] CAMEL-23226: Standardize error output to use printErr() in camel-jbang [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22163:
URL: https://github.com/apache/camel/pull/22163#issuecomment-4102949171

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-core`
   
   <details><summary>All tested modules (26 modules)</summary>
   
   - Camel :: Coverage
   - Camel :: Coverage                                                  [pom]
   - Camel :: JBang :: Core
   - Camel :: JBang :: Core                                             [jar]
   - Camel :: JBang :: Integration tests
   - Camel :: JBang :: Integration tests                                [jar]
   - Camel :: JBang :: MCP
   - Camel :: JBang :: MCP                                              [jar]
   - Camel :: JBang :: Main
   - Camel :: JBang :: Main                                             [jar]
   - Camel :: JBang :: Plugin :: Edit
   - Camel :: JBang :: Plugin :: Edit                                   [jar]
   - Camel :: JBang :: Plugin :: Generate
   - Camel :: JBang :: Plugin :: Generate                               [jar]
   - Camel :: JBang :: Plugin :: Kubernetes
   - Camel :: JBang :: Plugin :: Kubernetes                             [jar]
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: Route Parser                           [jar]
   - Camel :: JBang :: Plugin :: Testing
   - Camel :: JBang :: Plugin :: Testing                                [jar]
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: JBang :: Plugin :: Validate                               [jar]
   - Camel :: Launcher
   - Camel :: Launcher                                                  [jar]
   - Camel :: Launcher :: Container
   - Camel :: Launcher :: Container                                     [pom]
   
   </details>


-- 
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@camel.apache.org

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