# HG changeset patch # User Vladimir Marek # Date 1304071285 25200 # Node ID 8a66c0c0e8dc979d375e0ec8b52cd636e08f4f69 # Parent f37f16a2a99cc8d0fe74d951558a484254223fd0 7041047 userland-fetch should handle http errors more gracefully diff -r f37f16a2a99c -r 8a66c0c0e8dc tools/userland-fetch --- a/tools/userland-fetch Wed May 04 14:29:30 2011 -0700 +++ b/tools/userland-fetch Fri Apr 29 03:01:25 2011 -0700 @@ -102,6 +102,11 @@ printIOError(e, "Can't open url " + url) return None + # 3xx, 4xx and 5xx (f|ht)tp codes designate unsuccessfull action + if 3 <= int(src.getcode()/100) <= 5: + print "Error code: " + str(src.getcode()) + return None + if filename == None: filename = src.geturl().split('/')[-1]