membphis commented on code in PR #12036:
URL: https://github.com/apache/apisix/pull/12036#discussion_r2006708645
##########
apisix/plugins/ai-request-rewrite.lua:
##########
@@ -200,12 +200,8 @@ function _M.access(conf, ctx)
-- Handle LLM response
if res.status > 299 then
- core.log.error("LLM service returned error status: ", res.status, ",
err: ", err)
- local error_msg = "LLM service returned error status: " .. res.status
- if err then
- error_msg = error_msg .. ", err: " .. err
- end
- return HTTP_BAD_REQUEST, error_msg
+ core.log.error("LLM service returned error status: ", res.status, ",
", resp_body)
Review Comment:
The main identification here is the response code, which has nothing to do
with the response body. So, recording the response body in the log will not
provide any other obvious help.
In addition, the response body itself is relatively large and may contain
sensitive business information, which is not suitable for recording in the
error log.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]