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

Reliably set the exist status code on errors #125

Closed
ahochsteger opened this issue Jun 9, 2022 · 0 comments
Closed

Reliably set the exist status code on errors #125

ahochsteger opened this issue Jun 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ahochsteger
Copy link

Currently there are cases where an error correctly sets a status code <> 0 (e.g. on authentication failures) but other cases (e.g. host not reachable, HTTP 400/500) exit with success, making it hard to use in scripts.
I'd propose to always set an error code on hard errors (e.g. communication failures) and provide an option (similar to curl) to exit with an error status if the HTTP status code responds with an error (4xx/5xx).

@danielgtaylor danielgtaylor added the bug Something isn't working label Jun 20, 2022
danielgtaylor added a commit that referenced this issue Jan 19, 2023
feat: set exit code from status code, fixes #125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants