Skip to content

Commit

Permalink
error exception
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzz465 committed Mar 24, 2019
1 parent 5ac1b2d commit 1ace921
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/downloader.py
Expand Up @@ -27,11 +27,16 @@ def download_DB(): #shakeyourbunny's code. thank you!
return json.loads(dbrawdata)

except:
log.warning('cannot download DB from server. loading local DB files...')
with open('DB_template.json', mode='w') as jsonlocal:
dbrawdata = jsonlocal.read()
try:
log.warning('cannot download DB from server. loading local DB files...')
with open('DB_template.json', mode='w') as jsonlocal:
dbrawdata = jsonlocal.read()

return json.loads(dbrawdata)

return json.loads(dbrawdata)
except:
log.error('cannot found DB file from local. exit program...')
sys.exit(0)

if __name__ == '__main__':
DBtest = download_DB()
Expand Down

0 comments on commit 1ace921

Please sign in to comment.