2022-06-14 06:12:03 +08:00
|
|
|
c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
SPDX-License-Identifier: curl
|
2016-11-16 06:44:58 +08:00
|
|
|
Long: fail-early
|
|
|
|
Help: Fail on first transfer error, do not continue
|
|
|
|
Added: 7.52.0
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: curl
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: --fail-early $URL https://two.example
|
2021-11-15 22:58:20 +08:00
|
|
|
See-also: fail fail-with-body
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: boolean
|
2016-11-16 06:44:58 +08:00
|
|
|
---
|
2017-04-01 03:59:07 +08:00
|
|
|
Fail and exit on the first detected transfer error.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
|
|
|
When curl is used to do multiple transfers on the command line, it will
|
|
|
|
attempt to operate on each given URL, one by one. By default, it will ignore
|
|
|
|
errors if there are more URLs given and the last URL's success will determine
|
|
|
|
the error code curl returns. So early failures will be "hidden" by subsequent
|
|
|
|
successful transfers.
|
|
|
|
|
2017-04-01 10:36:46 +08:00
|
|
|
Using this option, curl will instead return an error on the first transfer
|
|
|
|
that fails, independent of the amount of URLs that are given on the command
|
|
|
|
line. This way, no transfer failures go undetected by scripts and similar.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2017-04-01 03:59:07 +08:00
|
|
|
This option is global and does not need to be specified for each use of --next.
|
|
|
|
|
|
|
|
This option does not imply --fail, which causes transfers to fail due to the
|
|
|
|
server's HTTP status code. You can combine the two options, however note --fail
|
|
|
|
is not global and is therefore contained by --next.
|