将 -504 服务调用超时列为常见错误

This commit is contained in:
amtoaer
2026-06-14 18:28:11 +08:00
parent 3ac56f6c4e
commit b60577cbc2
+8 -8
View File
@@ -27,13 +27,13 @@ impl BiliError {
} }
pub fn is_common_error(&self) -> bool { pub fn is_common_error(&self) -> bool {
matches!( if let BiliError::ErrorResponse { code, message, .. } = self {
self, for pair in [(-503, "服务暂不可用"), (-504, "服务调用超时")] {
BiliError::ErrorResponse { if *code == pair.0 && message.as_ref().is_some_and(|m| m == pair.1) {
code: -503, return true;
message, }
.. }
} if message.as_ref().is_some_and(|m| m == "服务暂不可用") }
) false
} }
} }