mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
Added try/except blocks.
This commit is contained in:
parent
dd1525c9b7
commit
125d182773
1 changed files with 19 additions and 3 deletions
|
@ -12,7 +12,23 @@ post_headers['Content-Type'] = 'application/json'
|
|||
post_headers['Expect'] = ''
|
||||
|
||||
post_url = 'https://highfidelity.sp.backtrace.io:6098/post?format=symbols&token=' + sys.argv[1] + '&upload_file=' + sys.argv[2] + '&tag=' + sys.argv[3]
|
||||
post_data = open(sys.argv[1], 'rb')
|
||||
|
||||
post_request = urllib.request.Request(post_url, post_data, post_headers)
|
||||
post_response = urllib.request.urlopen(post_request)
|
||||
try:
|
||||
post_data = open(sys.argv[2], 'rb')
|
||||
except:
|
||||
print('file ' + sys.argv[2] + ' not found')
|
||||
exit()
|
||||
|
||||
try:
|
||||
post_request = urllib.request.Request(post_url, post_data, post_headers)
|
||||
except:
|
||||
print('urllib.request.Request failed')
|
||||
exit()
|
||||
|
||||
try:
|
||||
post_response = urllib.request.urlopen(post_request)
|
||||
except:
|
||||
print('urllib.request.urlopen failed')
|
||||
exit()
|
||||
|
||||
print("No errors")
|
Loading…
Reference in a new issue