I'm not a professional developer, but I do code occasionally. Currently, I am working on some Apps Script code to interact with an API and store the data in SQL. Most of it is working fine, but I have encountered an issue while debugging in the Apps Script editor. Whenever I try to access a specific line of code, the editor throws a "could not connect to server" message at the top.
var response = UrlFetchApp.fetch(clientApiURL,options);
var resultSet = JSON.parse(response.getContentText()); <-- this is causing the IDE to crash
Does anyone have any suggestions on how to troubleshoot this situation better? The code functions correctly when not in debugging mode, but I need the debugger to analyze objects as the API has varying formats. Unfortunately, the editor crashes when I attempt to do so.
Any help or insight would be greatly appreciated. I have also included the value of response.getContentText() below:
{"result":{"lead":[{"id":"332","accountID":null,"ownerID":null,"companyName":"", ... snip ... ,"leadStatus":"customer","persona":"","product_5e554b933fb5b":""}]},"error":null,"id":"5222020","callCount":"215","queryLimit":"50000"}
This code snippet reproduces the error:
function test(){
var obj={"result":{"lead":[{"id":"332","accountID":null,"ownerID":null,"companyName":"", ... snip ... ,"leadStatus":"customer","persona":"","product_5e554b933fb5b":""}]},"error":null,"id":"5222020","callCount":"215","queryLimit":"50000"}
var resultSet = JSON.parse(obj);
}