This commit is contained in:
Timothy Jaeryang Baek 2025-08-11 17:38:00 +04:00
parent f890fe6901
commit 2df4e7207b

View file

@ -480,7 +480,14 @@ export const executeToolServer = async (
throw new Error(`HTTP error! Status: ${res.status}. Message: ${resText}`);
}
return await res.json();
let responseData;
try {
responseData = await res.json();
} catch (err) {
responseData = await res.text();
}
return responseData;
} catch (err: any) {
error = err.message;
console.error('API Request Error:', error);