Commit 06729b0f authored by jkvis's avatar jkvis

More on logging

parent 571fbf00
......@@ -289,6 +289,8 @@ def producer_upload(project_name, transfer_id):
try:
do_event(project, 'on_transfer_end', request, transfer.as_dict())
except ValueError:
# Even if some of the web hooks fail, the transfer is still
# successful.
pass
return jsonify(transfer.as_dict())
......@@ -460,7 +462,13 @@ def initiate_transfer(project, request):
os.chmod(os.path.join(project.primary_path,
transfer.id,
'.meta_data.json'), 0o660)
except (OSError, IOError, ValueError):
except (OSError, IOError) as excp:
LOGGER.info(json.dumps({'message': 'Primary path creation failed',
'exception': excp.strerror,
'request': log_request(request)}))
destroy_transfer(project, transfer, request)
return jsonify({'status': 400, 'message': 'Bad Request'}), 400
except ValueError:
destroy_transfer(project, transfer, request)
return jsonify({'status': 400, 'message': 'Bad Request'}), 400
......@@ -477,7 +485,13 @@ def initiate_transfer(project, request):
os.chmod(os.path.join(project.backup_path,
transfer.id,
'.meta_data.json'), 0o660)
except (OSError, IOError, ValueError):
except (OSError, IOError) as excp:
LOGGER.info(json.dumps({'message': 'Backup path creation failed',
'exception': excp.strerror,
'request': log_request(request)}))
destroy_transfer(project, transfer, request)
return jsonify({'status': 400, 'message': 'Bad Request'}), 400
except ValueError:
destroy_transfer(project, transfer, request)
return jsonify({'status': 400, 'message': 'Bad Request'}), 400
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment