View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009262CMakeCMakepublic2009-07-12 13:182016-06-10 14:30
ReporterEric NOULARD 
Assigned ToBill Hoffman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0009262: FILE(DOWNLOAD ) creates file containing HTTP error
DescriptionWhen using FILE(DOWNLOAD
the error handling behavior is a bit strange.

1) If you get "HTTP 404 Not Found" the
   STATUS is 0 --> no error

2) When the command fails with "HTTP 404 Not Found"
   the target file is created and contains
   the HTML error page.

I you want to catch this you have to MATCHES "404 Not Found"
in the LOG.

The attached cmake scripts (may be launched with cmake -P)
show how I did it.
Just change the url to a "Not Found" file and see how it behaves.

I'd rather want FILE(DOWNLOAD to report HTTP ERROR has error
and avoid to match the LOG myself.

Has the current behavior has been designed on purpose?
TagsNo tags attached.
Attached Files? file icon getMscStyle.cmake [^] (1,066 bytes) 2009-07-12 13:18

 Relationships
related to 0008903closedZach Mullen CTest does not check if CDash submission is successful 

  Notes
(0017431)
Bill Hoffman (manager)
2009-09-14 12:26

Well, it is not really an http error, the web server gave a page pack, it was a page not here page, but it was a page. I don't think curl can tell the difference, and I don't want to parse in cmake, I think...
(0017448)
Eric NOULARD (developer)
2009-09-14 13:27

Hi Bill,

Agreed you really don't want to parse it in cmake.

However, I think libcurl may tell you that it received an http error > 400
if you CURLOPT_FAILONERROR curl option is set to true.

If you did set this option to true then CURL will return you
CURLE_HTTP_RETURNED_ERROR (22)
when an HTTP ERROR is encountered.

This should be a similar problem reported on this bug:
http://public.kitware.com/Bug/view.php?id=8903 [^]

for which I suggested a similar solution :-)

Since it works for CTest I bet it should work for "FILE(DOWNLOAD" too.
(0041578)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2009-07-12 13:18 Eric NOULARD New Issue
2009-07-12 13:18 Eric NOULARD File Added: getMscStyle.cmake
2009-09-14 12:26 Bill Hoffman Note Added: 0017431
2009-09-14 12:26 Bill Hoffman Status new => assigned
2009-09-14 12:26 Bill Hoffman Assigned To => Bill Hoffman
2009-09-14 13:27 Eric NOULARD Note Added: 0017448
2011-02-03 18:51 David Cole Relationship added related to 0008903
2016-06-10 14:27 Kitware Robot Note Added: 0041578
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team