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