1
0
mirror of https://github.com/Adam-Ant/drone-trigger synced 2024-12-20 07:24:34 +00:00

Fix missing error catching

This commit is contained in:
Adam Dodman 2017-08-06 22:57:59 +01:00
parent 3ca4d2c950
commit e28fed6933

View File

@ -145,7 +145,11 @@ if __name__ == '__main__':
for service in config: for service in config:
if service == 'Connection': if service == 'Connection':
continue continue
new_value = jsonVal(config[service].get('url'), config[service].get('structure'))
try:
new_value = jsonVal(config[service].get('url'), config[service].get('structure'))
except:
continue
if (new_value != config[service]['current_value']): if (new_value != config[service]['current_value']):
print('[' + time.strftime("%d/%m/%Y %H:%M:%S") + '] Got new build - ' + new_value) print('[' + time.strftime("%d/%m/%Y %H:%M:%S") + '] Got new build - ' + new_value)
@ -157,6 +161,6 @@ if __name__ == '__main__':
config[service]['current_value'] = new_value config[service]['current_value'] = new_value
with open(filepath + '/dronetrigger.cfg', 'w') as configfile: with open(filepath + '/dronetrigger.cfg', 'w') as configfile:
config.write() config.write()
print("Successfully build new version for " + service) print('[' + time.strftime("%d/%m/%Y %H:%M:%S") + '] Successfully sent new build for ' + service)
time.sleep(sleep_time) time.sleep(sleep_time)