修复暂停下载继续后不结束下载的问题

This commit is contained in:
2025-10-06 21:26:34 +08:00
parent 480d357fdb
commit 3181a198fd
7 changed files with 127 additions and 37 deletions
+6 -5
View File
@@ -503,19 +503,20 @@ class FileManager {
throw error;
}
// 处理其他文件系统错误
const errorResult = ErrorHandler.handleFileSystemError(error, filePath, 'download');
// 检查是否是可重试的网络错误
const isRetryable = ErrorHandler.isRetryableError(error);
logger.error(`下载文件失败 (尝试 ${attempt}/${maxRetries}): ${filePath}`, {
error: error.message,
stack: error.stack,
url,
retryable: errorResult.retryable,
attempt
retryable: isRetryable,
attempt,
errorCode: error.code
});
// 如果不是可重试的错误,直接抛出
if (!errorResult.retryable) {
if (!isRetryable) {
throw error;
}