-
Notifications
You must be signed in to change notification settings - Fork 27
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
Error: "Unable to parse response body into JSON: 10 #2
Comments
I think it‘s nothing about json_decode, but the data responded from Nylas was invalid JSON. In Nylas's API docs, they said: I have checked the content type from the response header, like this: So, when it's not JSON, it will be returned directly without parsing. And, "Unable to parse response body into JSON: 10" means that: The reason is single unpaired UTF-16 surrogate in Unicode escape contained in the JSON string passed to json_encode(). I will add a new config option which can be used to control the exception throws when decoding the responded body. After it enabled, the body content will be returned directly without parsing when the json_decode error occurs. |
@lanlin awesome! Thank you! Will give it a go ASAP and let you know (probably only on Sunday). |
@lanlin OK fantastic, I managed to use this config option to work around the issue of the invalid json response from nylas. Turns out it was only 1 message from 1 account that was causing the issue. I have now built a workaround where I simply request smaller and smaller batches of messages until I get only valid messages, then I increment the offset to skip the invalid message. |
@robtesch That's good. |
Hi Lanlin,
I've hit a new issue, as described in the title. This is only happening on one account. If possible, would there be a way of simply ignoring if this error occurs on a single message, and move on to all the others? I have a feeling that for a single message the JSON is corrupt or something.
Thanks,
Rob
The text was updated successfully, but these errors were encountered: