This commit is contained in:
chengxl
2025-09-02 09:41:20 +08:00
parent 21d87fff91
commit 771bd9a657

View File

@@ -57,12 +57,12 @@ class ReviewerScore
$response = $oReviewer->score($aParam);
// 验证API响应
if (empty($response)) {
throw new RuntimeException("OpenAI API返回空结果");
throw new \RuntimeException("OpenAI API返回空结果");
}
// 检查JSON解析错误
$aResult = json_decode($response, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}");
throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}");
}
$sMsg = empty($aResult['msg']) ? '给审稿人评分处理失败' : $aResult['msg'];