You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SendGridClient.RequestAsync method returns a response with the status code of 200 when any exception is thrown. I ran into this as I wanted to implement retries in the even of transient errors. The easiest of which to create was disconnecting my PC from the internet (or at least the first I thought of). To my surprise I got a 200 OK suggesting nothing had gone wrong. I know that it returns a 202 Accepted when the email is actually sent so I can deal with this, but returning a 200 OK is pretty misleading.
Steps to Reproduce
Disconnect your PC from the internet
Try to send an email using this library
Check the response code (it will be 200 OK)
The text was updated successfully, but these errors were encountered:
@benmiller86: It could actually have been separate but similar errors in the code. But in this case one method (SendEmailAsync) calls the other (RequestAsync) so I will fix both by not swallowing the exception inside RequestAsync.
@ottomatic You are quite correct. I am actually consuming the SendEmailAsync method myself, but when I referred to the source code I saw that it was the RequestAsync method that was the issue.
Issue Summary
The
SendGridClient.RequestAsync
method returns a response with the status code of 200 when any exception is thrown. I ran into this as I wanted to implement retries in the even of transient errors. The easiest of which to create was disconnecting my PC from the internet (or at least the first I thought of). To my surprise I got a 200 OK suggesting nothing had gone wrong. I know that it returns a 202 Accepted when the email is actually sent so I can deal with this, but returning a 200 OK is pretty misleading.Steps to Reproduce
The text was updated successfully, but these errors were encountered: