more useful error output

This commit is contained in:
brent s. 2019-01-21 15:59:18 -05:00
parent e0ed3346aa
commit faa79046d3

View File

@ -438,9 +438,9 @@ def dbEntry(conf):
cur.execute(query) cur.execute(query)
cur.close() cur.close()
conn.close() conn.close()
except: except Exception as e:
print('{0}: There seems to have been some error when inserting into the DB. Check access (or it is a dupe).'.format( print('{0}: There seems to have been some error when inserting into the DB: {1}'.format(
datetime.datetime.now())) datetime.datetime.now(), e))


def signEp(mediatype, conf): def signEp(mediatype, conf):
# No reason to call this for each file. Fix. # No reason to call this for each file. Fix.
@ -494,8 +494,9 @@ def uploadFile(conf):
# and create if it doesn't exist. # and create if it doesn't exist.
# Also, no reason to call this for each file. # Also, no reason to call this for each file.
print('{0}: Syncing files to server...'.format(datetime.datetime.now())) print('{0}: Syncing files to server...'.format(datetime.datetime.now()))
subprocess.call(['rsync', subprocess.run(['rsync',
'-a', '-a',
'--info=progress2',
'{0}'.format(conf['local']['mediadir']), '{0}'.format(conf['local']['mediadir']),
'{0}@{1}:{2}S{3}/.'.format(conf['rsync']['user'], '{0}@{1}:{2}S{3}/.'.format(conf['rsync']['user'],
conf['rsync']['host'], conf['rsync']['host'],