fix: interview creation show real error msg instead of generic failure
- Backend: wrap AI call in try/catch, throw HttpException(503) with msg 'AI 服务暂时不可用,请稍后重试' - Backend: AllExceptionsFilter preserve original error message for non-HttpException errors - Frontend: handle string/object res.data, show statusCode as fallback when message is unavailable
This commit is contained in:
@@ -242,7 +242,8 @@ const startInterview = async () => {
|
||||
} else if (checkAuth(res)) {
|
||||
return // token 过期,已清除并跳转登录
|
||||
} else {
|
||||
const msg = res.data?.message || '创建面试失败'
|
||||
const errMsg = typeof res.data === 'string' ? res.data : (res.data?.message || '')
|
||||
const msg = errMsg || `创建面试失败(${res.statusCode})`
|
||||
messages.value.push({ role: 'ai', content: msg })
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user