You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Stephan Balmer (Jira)" <ji...@apache.org> on 2022/04/01 09:12:00 UTC

[jira] [Created] (CAMEL-17897) camel-exec fail exit code

Stephan Balmer created CAMEL-17897:
--------------------------------------

             Summary: camel-exec fail exit code
                 Key: CAMEL-17897
                 URL: https://issues.apache.org/jira/browse/CAMEL-17897
             Project: Camel
          Issue Type: New Feature
          Components: camel-exec
            Reporter: Stephan Balmer


The camel-exec component will log an error when an executed command exited with nonzero exit-code. But if I want the route to abort at that point, I need to add an extra check:
{code:java}
        <choice>
            <when>
                <simple>
                    ${headers.CamelExecExitValue} != 0
                </simple>
                <throwException exceptionType="java.lang.RuntimeException" message="command failed"/>
            </when>
        </choice> {code}
It would be useful to let the exec component generate an exception when the command fails, so that this check doesn't need to be performed.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)