cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: error code behaviour

From: Paul Harrington <paul_at_pizza.org>
Date: Fri, 15 Feb 2002 09:47:31 +0000

> I realizes that curl doesn't gives any errorcode, if the file is not
> there. Currently it writes the 404-error-code-webpage into the file it
> should normally fetch :-)) and the overall errorcode of the programm
> stays 0. How to get this info out of the program ? (Not via -w please)

     -f/--fail

          (HTTP) Fail silently (no output at all) on server
          errors. This is mostly done like this to better enable
          scripts etc to better deal with failed attempts. In
          normal cases when a HTTP server fails to deliver a doc­
          ument, it returns a HTML document stating so (which
          often also describes why and more). This flag will pre­
          vent curl from outputting that and fail silently
          instead.

Regards

Paul
Received on 2002-02-15