-
Notifications
You must be signed in to change notification settings - Fork 136
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
Reverse the exitcode initialization value #278
base: main
Are you sure you want to change the base?
Conversation
Summary of comments on this code to date: |
257601c
to
5df60ff
Compare
In case it matters, the PR is: If it were me, I would squash all the patches, adding a small note at the bottom for the extra changes wrt the original. Not a huge deal either way. Example:
Edit: and you've done it already, but the time I wrote this. Nice |
Btw would be nice to hear from @sjoerdsimons what testing he had in plan in the earlier PR #198. Perhaps even close the old/superseded PR. |
the comment was:
|
b7849db
to
f07de8d
Compare
50c408c
to
b8c84eb
Compare
With a bunch of tests in place (thanks Ed), can we get this trivial PR merged? |
I took another look at this and wasn't happy; decided it would be cleaner to rework the panics in the code to bubbled-up errors: go-debos/fakemachine#74 |
b8c84eb
to
f52631d
Compare
Fakemachine is subject to panic and causes Debos to exit success due to the current logic of the exitcode. For example, the fakemachine function CopyFileTo() panics if the file is missing. In the case of a panic, the function never returns. Thus, the exitcode cannot be set to 1 and Debos exits with 0. This commit reverses the logic of the exitcode: it is initialized to 1 (i.e. failure), and it is set to 0 (i.e. success) only if Debos has reached the end of the things it has to do (or for the help message). Co-authored-by: Gaël PORTAY <gael.portay@collabora.com> Co-authored-by: Santosh Mahto <santosh.mahto@collabora.com> Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
f52631d
to
d1b5660
Compare
@obbardc would probably be worth picking up the tests that were added here even if you ended up doing the error handlign improvements in another way? |
Yeah, I will pick the tests up from this PR and cherry pick onto !303. Once that is done I will close this PR. |
No description provided.