Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bin/libs/common.sh: print_error_and_exit can not use error codes > 255 #3828

Open
Martin-Zeithaml opened this issue May 13, 2024 · 3 comments
Labels
bug Something isn't working zwe

Comments

@Martin-Zeithaml
Copy link
Contributor

The function print_error_and_exit is ending with exit command, which accepts any number, however only the least significant 8bits are used.

For example: in case of missing useConfigmgr=true, this returns 60:

/zowe/bin: ./zwe components search --component-id org.zowe.zlux.sample.angular
Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use.
/zowe/bin: echo $?
60
@Martin-Zeithaml Martin-Zeithaml added bug Something isn't working zwe labels May 13, 2024
@JoeNemo
Copy link
Contributor

JoeNemo commented May 15, 2024

Sean suggests returning 8 for all failures and putting the particular status in a environment variable.

@Martin-Zeithaml
Copy link
Contributor Author

And the same for JS:

echo "import * as std from 'cm_std'; std.exit(316);" > test_exit.js
/zowe/bin/utils/configmgr -script test_exit.js
echo $?
60

@JoeNemo
Copy link
Contributor

JoeNemo commented May 22, 2024

This is an external breaking changes and should be done within the 3.0 releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working zwe
Projects
None yet
Development

No branches or pull requests

2 participants