-
Notifications
You must be signed in to change notification settings - Fork 41
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
Email requests using unverified email address in from
field are not thrown
#275
Comments
Hey @OussamaFadlaoui, would you mind sharing the request you're sending? |
@bukinoshita - an example I can give to back up @OussamaFadlaoui 's example is this
You'll see I have had to interrogate the data object to pull out the child error object with the below
as I do not hit the catch block even though the following error is displayed on the UI |
hey there, in the latest versions of the SDK basically all methods should always return correctly and not throw any errors, we do that so in your codebase you don't have to wrap our code in a if the requests fail for any reason, our SDK will return a populated using the example for an unverified domain the
please let us know if the issue still persists and feel free to reopen it in here 🙏 |
Obviously this is not my library, but I still want to say that having tries and catches all over code does not take away from the quality of a library. In fact, it is the proper way of handling errors. After all, this library is performing a promise, and promises are expected to either resolve or reject Therefore I find the reasons for this design decision to be a bit odd and steering away from the traditional way of using promises in third party libraries. |
Subject of the issue
I used the Node SDK package
resend
to send my first email. Upon using an unverified domain in thefrom
field, my request seemed to go OK (promise was not rejected). When I went to the dashboard, I discovered the request was rejected with status code 403:That's a valid point, however, why did the Promise not throw an appropriate error?
Steps to reproduce
resend
NPM packagefrom
fieldExpected behaviour
The promise should be rejected on 403 status codes..
Actual behaviour
No errors being thrown.
The text was updated successfully, but these errors were encountered: