-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Context
Firstly, thank you for this very handy tool ! We currently use it in our project.
We call it via a shell script like so :
execute_a() {
output=$(java -Djavax.net.ssl.keyStore=$KEYSTORE_PATH \
-Djavax.net.ssl.keyStorePassword=$KEYSTORE_PASSWORD \
-Djavax.net.ssl.trustStore=$TRUSTSTORE_PATH \
-Djavax.net.ssl.trustStorePassword=$TRUSTSTORE_PASSWORD \
-jar $BASEDIR/a-1.6.0-jar-with-dependencies.jar "$@" 2>&1)
local status=$?
if [ $status -eq 0 ]; then
echo "$output" >&1
else
echo "Error detected: $output" >&2
echo "exec_a() : exit $CODE_ERREUR" >&2
exit $CODE_ERREUR
fi
}
This execute_a() is called further down our the script like so :
execute_a -U $JMS_USERNAME -P $JMS_PASSWORD -b tcp://$HOSTNAME:61616 -X $PATH_TO_DUMP_FILE -c $NB_MESSAGES $QUEUE -w $WAIT
We recently upgraded from the version 1.4.6 to the latest version 1.6.0 and our scripts no longer sent the right exit code (ex: it sent code 0 when it should have returned an error code 2 in case of an error and the issue was because no exception).
Proposition
To simplify shell script (or another caller) error handling and to ensure that the tool exits with a non-zero exit status when an error occurs (in this case missing path argument for the dump file, or the path is provided but points to a non-existent file) I propose the replace the existant code :
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels