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

fix(exit-code): catch exit code #22

Merged
merged 2 commits into from
Jul 12, 2024
Merged

fix(exit-code): catch exit code #22

merged 2 commits into from
Jul 12, 2024

Conversation

Xaving
Copy link
Member

@Xaving Xaving commented Jun 17, 2024

In some case, the program exit with error and exit code of zero. Change this to exit with non zero code each time the list of error is not empty.

Copy link
Member

@hbollon hbollon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds okay to me, however:

  • This change will override the behavior of line 228 of hem_wrapper.go (see if we need to know the exact helm error code or if this line can be dropped).
  • Setting an error code of 1 when any error occurs may be acceptable if all these errors are considered critical, but in this case you'd also have to stop program execution. It may therefore be more appropriate to use a critical interrupt function (either a log.fatal or a custom function with the same behavior).

In some case, the program exit with error and exit code of zero. Change this to exit with non zero code each
time the list of error is not empty.
@Xaving
Copy link
Member Author

Xaving commented Jun 24, 2024

That sounds okay to me, however:

  • This change will override the behavior of line 228 of hem_wrapper.go (see if we need to know the exact helm error code or if this line can be dropped).
  • Setting an error code of 1 when any error occurs may be acceptable if all these errors are considered critical, but in this case you'd also have to stop program execution. It may therefore be more appropriate to use a critical interrupt function (either a log.fatal or a custom function with the same behavior).

I added a condition to not overwrite previous error code. And use a different exit code, before the program exits normally.

Copy link
Member

@hbollon hbollon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not optimal but acceptable 👍

@Xaving Xaving force-pushed the catch-exit-code branch 3 times, most recently from 8a54439 to adb38fa Compare June 28, 2024 06:53
In order to run go test, the dev sops key should be imported first.
@Xaving Xaving merged commit 4907724 into master Jul 12, 2024
2 checks passed
@Xaving Xaving deleted the catch-exit-code branch July 12, 2024 07:44
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

Successfully merging this pull request may close these issues.

2 participants