From ae40d46d6f5fb3ca08c333a420e33555ad42e4f5 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Fri, 22 May 2026 14:49:35 +0800 Subject: [PATCH] fix SuperError --- Tun/Super/SDLSuperClient.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tun/Super/SDLSuperClient.swift b/Tun/Super/SDLSuperClient.swift index a768047..8268832 100644 --- a/Tun/Super/SDLSuperClient.swift +++ b/Tun/Super/SDLSuperClient.swift @@ -12,7 +12,7 @@ import CryptoKit import Security // 定义错误类型,便于上层处理 -enum SDLQUICError: Error { +enum SDLSuperError: Error { case connectionFailed(Error) case connectionCancelled case writeFailed(Error) @@ -123,7 +123,7 @@ actor SDLSuperClient { } } - private func finishMessageContinuationIfNeed(throwing error: SDLQUICError?) { + private func finishMessageContinuationIfNeed(throwing error: SDLSuperError?) { guard !self.isMessageContinuationFinished else { return } @@ -181,7 +181,7 @@ actor SDLSuperClient { private func readOnce() async throws -> Data { guard let connection = self.connection else { - throw SDLQUICError.connectionCancelled + throw SDLSuperError.connectionCancelled } let readContinuation = OnceContinuation() @@ -196,7 +196,7 @@ actor SDLSuperClient { } if isComplete { - readContinuation.resume(throwing: SDLQUICError.dataStreamClosed) + readContinuation.resume(throwing: SDLSuperError.dataStreamClosed) } else { readContinuation.resume(returning: data ?? Data()) } @@ -263,7 +263,7 @@ extension SDLSuperClient { } if len > self.maxPacketSize { - throw SDLQUICError.packetTooLarge + throw SDLSuperError.packetTooLarge } guard buffer.readableBytes >= len + 2 else {