DEV Community

Discussion on: Flask Rest API -Part:5- Password Reset

Collapse
 
maccerata profile image
Maccerata

Hello, thank you for this great article. But when I've tested this uri: /api/auth/forgot with unknown email got error 500 InternalServerError.
So I've updated exception handling unknown e-mail address to:

    except User.DoesNotExist:
        raise EmailDoesnotExistsError
Enter fullscreen mode Exit fullscreen mode

Is the update in file reset_password.py correct? Seems to be, because now I'm getting error 400 instead of 500

But still wondering about casdade of errors before this one is rised. Is there better way to handle it?