improve upload error log messages

master
Kevin 2020-06-28 04:18:00 -05:00
parent 7f8e63f19b
commit 049956544e
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,7 @@ def accept_upload(request):
resp = 'success' resp = 'success'
else: else:
resp = 'failure' resp = 'failure'
logger.warn('Error encountered importing uploaded block') logger.warn(f'Error encountered importing uploaded block {b_hash}')
except onionrexceptions.BlacklistedBlock: except onionrexceptions.BlacklistedBlock:
logger.debug('uploaded block is blacklisted') logger.debug('uploaded block is blacklisted')
resp = 'failure' resp = 'failure'
@ -62,6 +62,7 @@ def accept_upload(request):
abort(400) abort(400)
elif resp == 'proof': elif resp == 'proof':
resp = Response(resp, 400) resp = Response(resp, 400)
logger.warn(f'Error encountered importing uploaded block, invalid proof {b_hash}')
else: else:
resp = Response(resp) resp = Response(resp)
return resp return resp