fix(phase-4): add DB error checking, mask sensitive auth tokens in API and middleware logs
This commit is contained in:
@@ -113,14 +113,11 @@ func (p *DeepSeekProvider) ChatCompletion(ctx context.Context, req *models.Unifi
|
||||
}
|
||||
|
||||
if !resp.IsSuccess() {
|
||||
var msg string
|
||||
if resp.RawBody() != nil {
|
||||
msg := resp.String()
|
||||
if msg == "" && resp.RawBody() != nil {
|
||||
bodyBytes, _ := io.ReadAll(resp.RawBody())
|
||||
msg = string(bodyBytes)
|
||||
}
|
||||
if msg == "" {
|
||||
msg = resp.String()
|
||||
}
|
||||
return nil, fmt.Errorf("DeepSeek API error (%d): %s", resp.StatusCode(), msg)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user