Fix error messages

This commit is contained in:
younesaassila 2024-08-21 17:46:54 +02:00
parent 1b594ce08b
commit 1bfed7cd62

View File

@ -32,7 +32,7 @@ export default async function onResponseStarted(
try { try {
proxy = getProxyFromDetails(details); proxy = getProxyFromDetails(details);
} catch (error) { } catch (error) {
errorMessage = `${error}`; errorMessage = error instanceof Error ? error.message : `${error}`;
} }
const requestParams = { const requestParams = {
@ -156,7 +156,7 @@ function getProxyFromDetails(
proxies.length !== 0 && store.state.dnsResponses.length === 0; proxies.length !== 0 && store.state.dnsResponses.length === 0;
if (isDnsError) { if (isDnsError) {
throw new Error( throw new Error(
"Cannot detect if requests are proxied or not (DNS error)" "Cannot detect if requests are being proxied due to a DNS error"
); );
} }
const ip = details.ip; const ip = details.ip;