[英]How can i fetch the error from the firebase backend?
I am working on the forgot password function of my system.我正在处理我系统的忘记密码 function。 Since firebase have it's own backend auth, i wanted to catch the error from firebase and populate it inside the modal.
由于 firebase 有自己的后端身份验证,我想从 firebase 捕获错误并将其填充到模态中。
Below you can see my forgot_password.js下面你可以看到我的 forgot_password.js
I wanted to fetch any error firebase auth would give me.我想获取 auth 给我的任何错误 firebase。
You can't use await with catch()
like that.您不能像那样将 await 与
catch()
一起使用。 Try using try...catch
尝试使用
try...catch
const handleResetPassword = (e) =? {
e.preventDefault();
try {
resetPassword(email);
} catch (error) {
console.log(e.message);
}
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.