The curl manual says HTTP error response codes do not count as transfer failure by default. A script can therefore receive an error document while treating the transfer as successful. This review examines documented command behavior; YNIX has not run a reliability benchmark or tested your API.

For HTTP, --fail returns error 22 for response codes of 400 or greater and suppresses the response body. The manual warns that this is not fail-safe, especially around authentication responses such as 401 and 407. An application should still verify its expected status and response content.

--fail-with-body is an alternative that retains the error response body while returning an error. It cannot be combined with --fail and was added in curl 7.76.0. Check the installed version before changing automation. Keep diagnostic bodies separate from files that another job might consume as valid output.

Verdict: these controls make curl useful in scripts only when the caller handles failure. For multiple transfers, --fail-early addresses early transfer errors but does not itself enable HTTP status failure. Write into a temporary destination, check exit status and expected content, then promote the result. Do not equate a nonempty file with a valid download.