Skip to content

Commit 75ccca3

Browse files
rootroot
authored andcommitted
fix: add proxy disconnection retry for network error handling
Add 'Proxy connection' to retryable error patterns in both core.ts and smart-poller.ts to handle proxy disconnection errors like "Proxy connection ended before receiving CONNECT response". Closes #118
1 parent 40bdfc1 commit 75ccca3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/api/controllers/core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ export async function request(
396396
error.message.includes('timeout') ||
397397
error.message.includes('network') ||
398398
error.message.includes('ECONNRESET') ||
399-
error.message.includes('socket hang up');
399+
error.message.includes('socket hang up') ||
400+
error.message.includes('Proxy connection');
400401

401402
if (isRetryableError && retries < maxRetries) {
402403
retries++;

src/lib/smart-poller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export class SmartPoller {
227227
error.message?.includes('timeout') ||
228228
error.message?.includes('network') ||
229229
error.message?.includes('ECONNRESET') ||
230-
error.message?.includes('socket hang up');
230+
error.message?.includes('socket hang up') ||
231+
error.message?.includes('Proxy connection');
231232

232233
// 网络错误时进行轮询级别的重试,而不是直接中断整个流程
233234
if (isRetryableError && this.pollCount < this.options.maxPollCount) {

0 commit comments

Comments
 (0)