Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-fail-early, --next & error №2 #10558

Closed
u20221022 opened this issue Feb 18, 2023 · 3 comments
Closed

--no-fail-early, --next & error №2 #10558

u20221022 opened this issue Feb 18, 2023 · 3 comments
Assignees

Comments

@u20221022
Copy link

I did this

  1. 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
  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

@bagder
Copy link
Member

bagder commented Feb 18, 2023

How is this related to --no-fail-early ?

@bagder
Copy link
Member

bagder commented Feb 18, 2023

I think this report means to say that the user expects the last error on the command line to be the exit code, but that is not how it currently works.

I checked, but it is not documented to work either way.

@u20221022
Copy link
Author

it is not documented

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-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants