Fail curl request on HTTP error status #2009
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use the `-f' option to instruct curl to exit with a non-zero exit code if the HTTP response indicates an error via its status code. This is the default behavior for wget, but curl will send the request and exit normally (with exit code equals to zero), as long as it's received a response from the server.
Note that this issue is already fixed by #1908. The only change this pull request does is change two lines to add the `-f' option to curl. I figured that since GitHub is blocking users that are logged off from downloading repository files1, this would be useful since my user.js file is being updated incorrectly, and GitHub's error message is being erroneously written to that file.
Footnotes
https://github.com/orgs/community/discussions/159123 ↩