Sendgrid-nodejs: Sendgrid errors list to identify error in try/catch.

Created on 23 Nov 2018  ·  3Comments  ·  Source: sendgrid/sendgrid-nodejs

Issue Summary

Where can I find the list of all the errors which the @sendgrid/mail client will throw while sending email?
I inspected the library code its returning request promises at the end. I need to identify the error in my catch block used with async/await as there are other requests as well in the same block where sendgrid call is initialized.

unknown or a waiting for feedback question

Most helpful comment

You would put another try/catch around the sendgrid module to handle those errors :)

All 3 comments

You would put another try/catch around the sendgrid module to handle those errors :)

Hello @umarhussain15,

Here is a list of all the errors that SendGrid could possibly throw.

Thanks for helping out @kevinsimper!

With Best Regards,

Elmer

Thanks, I forgot to look at the docs. I was only looking at guide.
@kevinsimper thanks for solution regarding try/catch. I was converting my code from promises chaining to async/await, so I was hesitant to use mutiple try/catch but in the end this gives more control.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prasoonjalan picture prasoonjalan  ·  3Comments

thinkingserious picture thinkingserious  ·  4Comments

Loriot-n picture Loriot-n  ·  4Comments

agostonbonomi picture agostonbonomi  ·  3Comments

egges picture egges  ·  3Comments