mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-22 19:52:14 +08:00
fix: report legacy TLS subscription failures
This commit is contained in:
@@ -24,6 +24,14 @@ use std::time::Duration;
|
||||
|
||||
static CURRENT_SWITCHING_PROFILE: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
fn profile_import_error(err: &anyhow::Error) -> std::string::String {
|
||||
if let Some(cause) = err.chain().find(|cause| cause.to_string().contains("TLS 1.0/1.1")) {
|
||||
return cause.to_string();
|
||||
}
|
||||
|
||||
format!("导入订阅失败: {err:#}")
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_profiles() -> CmdResult<SharedDraft<IProfiles>> {
|
||||
logging!(debug, Type::Cmd, "获取配置文件列表");
|
||||
@@ -70,7 +78,7 @@ pub async fn import_profile(url: std::string::String, option: Option<PrfOption>)
|
||||
}
|
||||
Err(e) => {
|
||||
logging!(error, Type::Cmd, "[导入订阅] 下载失败: {}", e);
|
||||
return Err(format!("导入订阅失败: {}", e).into());
|
||||
return Err(profile_import_error(&e).into());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user