-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting SyntaxError: Unterminated string literal error #17
Comments
Thanks for the report I'll take a look on the weekend |
The appscript command that parses the JSON is failing, but the JSON coming back from WPT looks valid so I need to dig in more. |
I am getting the same errors. I believe the problem is the JSON returned is returned in chunks and the UrlFetchApp.fetch function may just "think" its done after receiving the first chunk and return the incomplete JSON body causing that error. If you check the execution transcript you will see something like: [17-07-28 18:26:29:043 PDT] Sheet.getRange([M1]) [0.053 seconds] Here is the code (marking in bold the code that triggers that error): I tried adding the optional parameter "muteHttpExceptions: true" to the UrlFetchApp.fetch call but didn't fix the issue Any ideas? (This error comes randomly on different rows, but once it triggers it does not go away) |
I did some debugging (added the Logger line below) and I can confirm in the logs the JSON body is truncated at around 8KB (no idea why)
Logs: |
@javiergarza Thanks for digging into this - I'll try to take a look at it over the next week or so |
I'm curious if this issue has been looked into any further as I'm running into the same thing frequently but only on certain tests. As @javiergarza stated, the response is limited to 8kb which sticks out to me only because I know it's a common practice by CDN's, servers, and hosting providers to limit the response headers to a max of 8kb. Not sure if it's related but I'm curious if there's a correlation. |
Hi Andy,
Because of the 200 test cap per API key, I sometimes provision a series of tests and use the WPT-Bulk-Tester sheet to fetch the results by pasting the WPT results URL to the WPT ID column and running Get Results function. Recently, the sheet seems to be failing with the following error:
SyntaxError: Unterminated string literal
It correctly parses and fetches the results of other (older) WPT results though.
Here is one example WPT results ID where it fails:
https://www.webpagetest.org/result/161003_10_5327eec3e3713d1a1a3d75f233666a36/
Any idea why?
The text was updated successfully, but these errors were encountered: