mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-07 16:37:13 +08:00
将 -504 服务调用超时列为常见错误
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user