2
0

fail-early.d 1.1 KB

123456789101112131415161718192021222324
  1. Long: fail-early
  2. Help: Fail on first transfer error, do not continue
  3. Added: 7.52.0
  4. Category: curl
  5. Example: --fail-early $URL https://two.example
  6. See-also: fail fail-with-body
  7. ---
  8. Fail and exit on the first detected transfer error.
  9. When curl is used to do multiple transfers on the command line, it will
  10. attempt to operate on each given URL, one by one. By default, it will ignore
  11. errors if there are more URLs given and the last URL's success will determine
  12. the error code curl returns. So early failures will be "hidden" by subsequent
  13. successful transfers.
  14. Using this option, curl will instead return an error on the first transfer
  15. that fails, independent of the amount of URLs that are given on the command
  16. line. This way, no transfer failures go undetected by scripts and similar.
  17. This option is global and does not need to be specified for each use of --next.
  18. This option does not imply --fail, which causes transfers to fail due to the
  19. server's HTTP status code. You can combine the two options, however note --fail
  20. is not global and is therefore contained by --next.