简体   繁体   English

我如何从 firebase 后端获取错误?

[英]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.

相关问题 我可以使用 firebase 作为 flutter 桌面应用程序的后端吗? 如果有怎么办? - Can I use firebase as a backend for flutter desktop app? If so how? 我无法从 Firebase 获取数据到 Vue - I can't fetch data from Firebase to Vue 我如何使用一种方法从 Firebase 实时数据库中获取单个值 - How can i fetch single value from Firebase real time database using a method 如何使用 firebase v9 从实时数据库中获取数据? - How can i fetch data from realtime database using firebase v9? 如何使用 javascript 从 firebase 中的键中获取值 - How do I fetch the value from a key in firebase using javascript 我如何托管使用 firebase 作为其后端的 react crud 应用程序 - how can i host a react crud appliction that uses firebase as its backend 如何使用 NextJs 在 getServerSideProps 中从 Firebase 获取数据 - How to fetch data from Firebase in getServerSideProps with NextJs 我如何使用我的 Node/Express 和 Firebase 后端将用户保留在我的 web 应用程序上 - How can i persist users on my web application with my Node/Express and Firebase backend 如何显示来自 firebase 的图像? - how can i display image from firebase? 如何从 firebase 获取数据并更新 - How to fetch data and update it from firebase
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM