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

Errors are printed to STDOUT instead of STDERR #16

Open
KevinFCormier opened this issue Feb 3, 2021 · 0 comments
Open

Errors are printed to STDOUT instead of STDERR #16

KevinFCormier opened this issue Feb 3, 2021 · 0 comments

Comments

@KevinFCormier
Copy link
Collaborator

All the scripts seem to use printf to print errors to stdout before exiting. For example:

https://github.com/open-cluster-management/lifeguard/blob/main/clusterpools/apply.sh#L38

printf "${RED}Unable to create AWS Credentials Secret. See above message for errors.  Exiting."
exit 3

I think as a standard practice, errors should be printed to stderr.

I am invoking some of these scripts from other scripts, so in some cases I need to suppress the output or process the output for logging, etc. This made it difficult to debug because execution was stopped when your script exited with an error code, but I did not have the benefit of seeing the output saying that I was missing gsed.

I am happy to create a PR for this, but I wanted to check first if you are in agreement with this!

@KevinFCormier KevinFCormier changed the title Errors are printed to STDERR instead of STDOUT Errors are printed to STDOUT instead of STDERR Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant