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

Suggestion: report exit status #429

Closed
piramiday opened this issue Sep 17, 2020 · 5 comments
Closed

Suggestion: report exit status #429

piramiday opened this issue Sep 17, 2020 · 5 comments

Comments

@piramiday
Copy link

it would be useful to be able to report success or failure using only the exit status:

bash my-script.sh
curl https://hc-ping.com/xxxyyyzzz/$?

so that:

  • https://hc-ping.com/xxxyyyzzz/0 means success,
  • https://hc-ping.com/xxxyyyzzz/1 and other numbers mean failure.

this would make scripts shorter and would help to avoid the uglier if checks on the exit status.
ideally, it could be useful to store and show to the user the actual exit code $?, but that's another matter because it requires changing a lot more.

@cuu508
Copy link
Member

cuu508 commented Sep 28, 2020

That's a great suggestion, much cleaner than if logic.
I'm planning on implementing it.

@cuu508 cuu508 closed this as completed in 81e59ac Oct 28, 2020
@cuu508
Copy link
Member

cuu508 commented Oct 28, 2020

This now implemented, deployed and ready for testing. Any and all feedback welcome!

@piramiday
Copy link
Author

happy to help! 🎉

@piramiday
Copy link
Author

just got my first failure of a check for which I use the curl https://hc-ping.com/xxxyyyzzz/$? feature.
from the dasboard I can read a message like "Ping #XX (received via the /fail endpoint)" -- that mentions the /fail endpoint incorrectly -- and I see no mention of the reported exit status, which would help in debugging.

should I open up another issue with the feature suggestion of making the reported exit statuses transparent to the user?
IMHO even reporting the correct endpoint invoked by my curl would help, e.g. /2 endpoint, no need to change graphics or add labels.

@cuu508
Copy link
Member

cuu508 commented Nov 27, 2020

Thanks for the report @piramiday. There's a recent issue (#455) also about exposing the exit status, tlet's track this there.

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

2 participants