Use exit(1) on errors

This commit is contained in:
NissimHadar 2019-05-01 10:10:28 -07:00
parent 867f1f80df
commit b9e2174fe9

View file

@ -19,18 +19,18 @@ try:
post_data = open(sys.argv[2], 'rb')
except:
print('file ' + sys.argv[2] + ' not found')
exit()
exit(1)
try:
post_request = urllib.request.Request(post_url, post_data, post_headers)
except:
print('urllib.request.Request failed')
exit()
exit(1)
try:
post_response = urllib.request.urlopen(post_request)
except:
print('urllib.request.urlopen failed')
exit()
exit(1)
print("Upload to BackTrace completed without errors")