tools/userland-fetch
changeset 212 8a66c0c0e8dc
parent 137 6fb20db3eee4
child 800 2ad056ed89ec
--- 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]