Processing exceptions

This commit is contained in:
codez0mb1e 2022-10-17 22:44:14 +00:00
parent 3882efc9a2
commit 28450cdeab

View File

@ -133,7 +133,11 @@ for pair in usd_pairs:
print(f'INFO | {pair} > Starting insert to DB...') print(f'INFO | {pair} > Starting insert to DB...')
print('DEBUG | {} rows from {} to {}'.format(df.shape[0], min(df['time']), max(df['time']))) print('DEBUG | {} rows from {} to {}'.format(df.shape[0], min(df['time']), max(df['time'])))
try:
db_conn.insert(df, 'crypto', db_mapping) db_conn.insert(df, 'crypto', db_mapping)
except Exception as ex:
print(f'ERROR | {pair} > {ex}')
else: else:
print(f'WARN | {pair} > No new records') print(f'WARN | {pair} > No new records')
else: else: