fix: api error handle
This commit is contained in:
parent
dd78670a4b
commit
38d1fde84f
@ -88,13 +88,9 @@ export async function updateProxy(group: string, proxy: string) {
|
|||||||
|
|
||||||
// get proxy
|
// get proxy
|
||||||
async function getProxiesInner() {
|
async function getProxiesInner() {
|
||||||
try {
|
|
||||||
const instance = await getAxios();
|
const instance = await getAxios();
|
||||||
const response = await instance.get<any, any>("/proxies");
|
const response = await instance.get<any, any>("/proxies");
|
||||||
return (response?.proxies || {}) as Record<string, ApiType.ProxyItem>;
|
return (response?.proxies || {}) as Record<string, ApiType.ProxyItem>;
|
||||||
} catch {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the Proxy information
|
/// Get the Proxy information
|
||||||
@ -151,7 +147,6 @@ export async function getProxies() {
|
|||||||
|
|
||||||
// get proxy providers
|
// get proxy providers
|
||||||
export async function getProviders() {
|
export async function getProviders() {
|
||||||
try {
|
|
||||||
const instance = await getAxios();
|
const instance = await getAxios();
|
||||||
const response = await instance.get<any, any>("/providers/proxies");
|
const response = await instance.get<any, any>("/providers/proxies");
|
||||||
|
|
||||||
@ -166,9 +161,6 @@ export async function getProviders() {
|
|||||||
return type === "http" || type === "file";
|
return type === "http" || type === "file";
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// proxy providers health check
|
// proxy providers health check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user