CocoaPods / cocoapods-downloader

A small library that provides downloaders for various source types (HTTP/SVN/Git/Mercurial)
MIT License
84 stars 71 forks source link

[HTTP] Make it fail when a HTTP error status code is returned #41

Closed alloy closed 9 years ago

alloy commented 9 years ago

E.g. this should fail

~/tmp » 
curl -O https://www.dropbox.com/developers/downloads/sdks/datastore/ios/dropbox-ios-sync-sdk-3.1.1.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   613    0   613    0     0    362      0 --:--:--  0:00:01 --:--:--   362
~/tmp » unzip dropbox-ios-sync-sdk-3.1.1.zip 
Archive:  dropbox-ios-sync-sdk-3.1.1.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of dropbox-ios-sync-sdk-3.1.1.zip or
        dropbox-ios-sync-sdk-3.1.1.zip.zip, and cannot find dropbox-ios-sync-sdk-3.1.1.zip.ZIP, period.
~/tmp » cat dropbox-ios-sync-sdk-3.1.1.zip 

<!DOCTYPE html>
<html>
<head><title>Dropbox - 404</title>
<link href="https://www.dropbox.com/static/css/error.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/static/images/favicon.ico"/>
</head>
<body>
<div class="figure">
<img src="/static/images/psychobox.png" alt="Error:"/>
</div>
<div id="errorbox">
<h1>Error (404)</h1>We can't find the page you're looking for. Check out our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
</div>

</body>
</html>