From 701f0f3e576fe118fcf616aa3cf7eac3f90c0b55 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 26 Oct 2024 19:11:31 +0530 Subject: [PATCH] fix: error handle --- src/api/proxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/proxy.ts b/src/api/proxy.ts index 55cffacd..4ca79742 100644 --- a/src/api/proxy.ts +++ b/src/api/proxy.ts @@ -6,10 +6,10 @@ export const sendProxyConfig = async (proxyConfig: { server_url: string, usernam if (response.status === 200) { return response.data; } else { - throw new Error(`Failed to submit proxy configuration. Try again.`); + throw new Error(`Failed to submit proxy configuration. Status code: ${response.status}`); } } catch (error: any) { - console.log(error); + console.error('Error sending proxy configuration:', error.message || error); return false; } }