This commit is contained in:
2026-08-12 12:35:32 +08:00
parent 11e085e30f
commit 4fb8b85c13
22 changed files with 161 additions and 47 deletions
+6
View File
@@ -80,6 +80,12 @@ describe('API error diagnostics', () => {
})
})
it('does not expose local exception text in user-facing diagnostics', () => {
expect(getApiErrorDetails(new Error('Error: socket failed\\n at internal/request.ts:42'))).toEqual({
message: '接口请求失败', code: undefined, requestId: undefined, traceId: undefined,
})
})
it('notifies session expiry once when concurrent 401 requests share a failed refresh', async () => {
const refresh = vi.fn(async () => { throw new Error('refresh token expired') })
const expired = vi.fn()