-
Notifications
You must be signed in to change notification settings - Fork 778
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
Unhandled exception while parsing response body #347
Comments
Thanks for the issue @MaxMadylius! I've added this to our backlog for an investigation and fix. |
this is serious, please fix! |
You can simulate it easily with providing an invalid URL. This is what happens:
This should not crash, but rather should return an error to the callback! |
It seems that SendGrid is always expecting a JSON reply. Removing 110 altogether provides:
...which would obviously fail the parser. |
Thanks for the votes @Core-Process, @sgehly! I have added them to this item in our backlog. |
Just had this happen. Not sure what the exact payload was that triggered it, but it looks like we got a HTML response back which resulted in:
On v4.8.3 of this package. |
Thanks for helping us verify the issue @danconnell! Also, I've added your vote to this issue in our backlog. |
Hello Everyone, I believe v4.9 fixed this issue. Please let me know if you continue to experience issues after upgrading. Thanks! |
Just got this in 5.1.1. Reason was I copypasted endpoint url from docs and forgot to prepend request path with "/v3". It would be nice to get proper 404 and not SyntaxError in this case. |
Thanks for the heads up @maximivanov. I think this issue will be fixed with this PR: #378 |
Issue Summary
In some cases SendGrid returns html response. For example if we send email over 25 mb.
If response.body is not json it causes crash.
Technical details:
Unhandled exception occurs in sendgrid.js file line 95 and 110.
The text was updated successfully, but these errors were encountered: