fix missing empty strings logged when errors
This commit is contained in:
parent
2543db87e8
commit
0e6aadf5e1
|
@ -75,7 +75,7 @@ def generate():
|
|||
else:
|
||||
raise Exception
|
||||
|
||||
log_prompt(client_ip, token, request_json_body['prompt'], backend_response, None, parameters, dict(request.headers), response if response else 0)
|
||||
log_prompt(client_ip, token, request_json_body['prompt'], '', None, parameters, dict(request.headers), response if response else 0)
|
||||
return jsonify({
|
||||
'code': 500,
|
||||
'error': 'failed to reach backend',
|
||||
|
@ -112,7 +112,7 @@ def generate():
|
|||
}
|
||||
else:
|
||||
raise Exception
|
||||
log_prompt(client_ip, token, request_json_body['prompt'], backend_response, elapsed_time, parameters, dict(request.headers), response.status_code)
|
||||
log_prompt(client_ip, token, request_json_body['prompt'], '', elapsed_time, parameters, dict(request.headers), response.status_code)
|
||||
return jsonify({
|
||||
'code': 500,
|
||||
'error': 'the backend did not return valid JSON',
|
||||
|
|
Reference in New Issue