bitfoundation / bitplatform

Build all of your apps using what you already know and love ❤️
https://bitplatform.dev
MIT License
1.07k stars 222 forks source link

Catch error of email sending failure in TodoTemplate #1769

Closed RezaKargar closed 2 years ago

RezaKargar commented 2 years ago

When a failure happens during sending email for user confirmation or password reset, the Api does not catch that failure exception in proper way that client knows, so the user is not properly aware of the problem

ysmoradi commented 2 years ago

Do we return the Ok status code in such a scenario?

RezaKargar commented 2 years ago

Do we return the Ok status code in such a scenario?

No, The Api returns 500 Internal Server Error

image

ysmoradi commented 2 years ago

That's fine, what are you looking for?

RezaKargar commented 2 years ago

Isn't better we let the client know that there is some failure?

ysmoradi commented 2 years ago

It's a UX concern. Let's @maryamhdr decide about this.

vintagemarianne commented 2 years ago

When a failure happens during sending email for user confirmation or password reset, the Api does not catch that failure exception in proper way that client knows, so the user is not properly aware of the problem

Let's talk about this issue too 👍🏻

RezaKargar commented 2 years ago

As my talk with @maryamhdr this is not a UX thing, In exception handling of the DoSignUp in SignUp.razor.cs we only catch ResourceValidationException and KnownException and the Email sending failure is an Exception which we do not catch:

https://github.com/bitfoundation/bitframework/blob/b3b83c1a1e43312e8215dca31ff607df94265cb9/src/Tooling/Bit.Tooling.Templates/TodoTemplate/Web/Pages/SignUp.razor.cs#L96-L107

ysmoradi commented 2 years ago

I've already discussed this with @msynk We've nothing to do with unknown exceptions in our pages and we only handle specific exceptions in our pages. The remaining exceptions will go through global exception handling and at there, we can show toast for all of them We can also log those exceptions later. @RezaKargar @maryamhdr

RezaKargar commented 2 years ago

So I close this issue