fail-early.d 1.1 KB

12345678910111213141516171819202122232425
  1. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. SPDX-License-Identifier: curl
  3. Long: fail-early
  4. Help: Fail on first transfer error, do not continue
  5. Added: 7.52.0
  6. Category: curl
  7. Example: --fail-early $URL https://two.example
  8. See-also: fail fail-with-body
  9. Multi: boolean
  10. Scope: global
  11. ---
  12. Fail and exit on the first detected transfer error.
  13. When curl is used to do multiple transfers on the command line, it attempts to
  14. operate on each given URL, one by one. By default, it ignores errors if there
  15. are more URLs given and the last URL's success determines the error code curl
  16. returns. So early failures are "hidden" by subsequent successful transfers.
  17. Using this option, curl instead returns an error on the first transfer that
  18. fails, independent of the amount of URLs that are given on the command
  19. line. This way, no transfer failures go undetected by scripts and similar.
  20. This option does not imply --fail, which causes transfers to fail due to the
  21. server's HTTP status code. You can combine the two options, however note --fail
  22. is not global and is therefore contained by --next.