diff --git a/frontend/src/utils/sqlErrorSemantics.test.ts b/frontend/src/utils/sqlErrorSemantics.test.ts index 819229b4..02d1b3f3 100644 --- a/frontend/src/utils/sqlErrorSemantics.test.ts +++ b/frontend/src/utils/sqlErrorSemantics.test.ts @@ -37,6 +37,13 @@ describe('formatSqlExecutionError', () => { expect(formatted).toContain('Raw error: driver returned unexpected status 123'); }); + it('recognizes driver bad connection during SQL execution as timeout semantics', () => { + const formatted = formatSqlExecutionError('第 1 条语句执行失败:driver: bad connection'); + + expect(formatted).toContain('Semantic meaning: Query timed out or was canceled'); + expect(formatted).toContain('Raw error: 第 1 条语句执行失败:driver: bad connection'); + }); + it('recognizes localized connection-timeout wrappers as timeout semantics', () => { const translate = (key: string, params?: Record) => { if (key === 'query_editor.sql_error.wrapper.semantic_line') {