Skip to content
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

better error handling in email #6599

Merged
merged 1 commit into from Jun 9, 2020

Conversation

petersg83
Copy link
Contributor

@petersg83 petersg83 commented Jun 9, 2020

fix #6543

What I did

  • log correctly the error from the provider on server side and send a 500 to user.
  • send 400 error to user in case the error concerns the resquest (bad email for example). Only on strapi-provider-email-mailgun for the moment.

What should be done in the future

  • Each provider should handler its own errors by adding a statusCode to the error it throws. 400 if it concerns a bad request, 500 if it's something else. Won't be done in the PR as it takes time and is not a priority.

Signed-off-by: Pierre Noël <petersg83@gmail.com>
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexandrebodin alexandrebodin added this to the 3.0.2 milestone Jun 9, 2020
@alexandrebodin alexandrebodin added issue: bug Issue reporting a bug source: core:email Source is core/email package labels Jun 9, 2020
@alexandrebodin alexandrebodin merged commit 9f277f6 into master Jun 9, 2020
@alexandrebodin alexandrebodin deleted the fix/6543/betterEmailErrorHandling branch June 9, 2020 10:11
ashbrener pushed a commit to ashbrener/strapi that referenced this pull request Jun 9, 2020
Signed-off-by: Pierre Noël <petersg83@gmail.com>
Signed-off-by: ashbrener <ashley@starlogik.com>
iicdii pushed a commit to iicdii/strapi that referenced this pull request Jul 2, 2020
Signed-off-by: Pierre Noël <petersg83@gmail.com>
Signed-off-by: harimkims <harimkims@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:email Source is core/email package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email plugin is not working
3 participants