From b60577cbc2e4ebb04fa25d6f72d14a04a46746c9 Mon Sep 17 00:00:00 2001 From: amtoaer Date: Sun, 14 Jun 2026 18:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20-504=20=E6=9C=8D=E5=8A=A1=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E8=B6=85=E6=97=B6=E5=88=97=E4=B8=BA=E5=B8=B8=E8=A7=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/bilibili/error.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/bili_sync/src/bilibili/error.rs b/crates/bili_sync/src/bilibili/error.rs index 4e09ca3..adaf3fc 100644 --- a/crates/bili_sync/src/bilibili/error.rs +++ b/crates/bili_sync/src/bilibili/error.rs @@ -27,13 +27,13 @@ impl BiliError { } pub fn is_common_error(&self) -> bool { - matches!( - self, - BiliError::ErrorResponse { - code: -503, - message, - .. - } if message.as_ref().is_some_and(|m| m == "服务暂不可用") - ) + if let BiliError::ErrorResponse { code, message, .. } = self { + for pair in [(-503, "服务暂不可用"), (-504, "服务调用超时")] { + if *code == pair.0 && message.as_ref().is_some_and(|m| m == pair.1) { + return true; + } + } + } + false } }