mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-08-29 02:36:11 -06:00
Merge pull request #1790 from henrybarreto/feat/improve-test-proxy-error
feat: enhance logging for proxy testing errors
This commit is contained in:
commit
40ce6b56ca
@ -53,15 +53,21 @@ export class ProxyController {
|
|||||||
httpsAgent: makeProxyAgent(proxy),
|
httpsAgent: makeProxyAgent(proxy),
|
||||||
});
|
});
|
||||||
|
|
||||||
return response?.data !== serverIp?.data;
|
const result = response?.data !== serverIp?.data;
|
||||||
} catch (error) {
|
if (result) {
|
||||||
if (axios.isAxiosError(error) && error.response?.data) {
|
logger.info('testProxy: proxy connection successful');
|
||||||
logger.error('testProxy error: ' + error.response.data);
|
|
||||||
} else if (axios.isAxiosError(error)) {
|
|
||||||
logger.error('testProxy error: ');
|
|
||||||
} else {
|
} else {
|
||||||
logger.error('testProxy error: ');
|
logger.warn("testProxy: proxy connection doesn't change the origin IP");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} catch (error) {
|
||||||
|
if (axios.isAxiosError(error)) {
|
||||||
|
logger.error('testProxy error: axios error: ' + error.message);
|
||||||
|
} else {
|
||||||
|
logger.error('testProxy error: unexpected error: ' + error);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user