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

Add curl error handling options #5

Open
danielshahaf opened this issue Aug 28, 2022 · 0 comments
Open

Add curl error handling options #5

danielshahaf opened this issue Aug 28, 2022 · 0 comments

Comments

@danielshahaf
Copy link

curl is invoked as follows:

response=$(curl -A "commons-category-downloader/1 (https://github.com/aucuparia/commons-category-downloader)" --silent --data-urlencode "gcmtitle=Category:$category" "$apiquery")

Please consider adding the --show-error (-S) and --fail (-f) options as well. Without -S, it's possible for curl to emit only the first part of the requested resource. -f makes curl exit non-zero in that case. The script doesn't check the exit code currently, but that could be added later, or people could run the script under bash -e; until then, adding -f would do no harm.

Thanks for writing this tool and publishing it!

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

1 participant