curl.exe --write-out "%{exitcode}\n%{errormsg}\n"
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information Echo %ErrorLevel%
2
curl.exe --no-fail-early --head --write-out "%{exitcode}\n%{errormsg}\n" "https://curl_.se" --next --write-out "%{exitcode}\n%{errormsg}\n"
curl: (6) Could not resolve host: curl_.se
6
Could not resolve host: curl_.se
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information Echo %ErrorLevel%
6
curl.exe --manual | FindStr /C:"By de-" /C:"more URLs" /C:"last URL's" /C:"failures will be" /N
1253: it will attempt to operate on each given URL, one by one. By de-
1254: fault, it will ignore errors if there are more URLs given and
1255: the last URL's success will determine the error code curl re-
1256: turns. So early failures will be "hidden" by subsequent success-
I did this
curl.exe --write-out "%{exitcode}\n%{errormsg}\n"
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
Echo %ErrorLevel%
2
curl.exe --no-fail-early --head --write-out "%{exitcode}\n%{errormsg}\n" "https://curl_.se" --next --write-out "%{exitcode}\n%{errormsg}\n"
curl: (6) Could not resolve host: curl_.se
6
Could not resolve host: curl_.se
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
Echo %ErrorLevel%
6
I expected the following
curl: (2) no URL specified!
2
no URL specified!
= = = or = = =
ErrorLevel = 2
curl/libcurl version
7.88.0
[curl -V output]
curl 7.88.0 (x86_64-w64-mingw32) libcurl/7.88.0 OpenSSL/3.0.8 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 WinIDN libssh2/1.10.0 nghttp2/1.52.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0
Release-Date: 2023-02-15
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe TLS-SRP UnixSockets zstd
operating system
MS Windows 10
The text was updated successfully, but these errors were encountered: