简体   繁体   English

如何处理 FirebaseAuthException?

[英]How Can I Handle FirebaseAuthException?

I coded self-defined function for checking email and password with using Firebase, as follows;我用Firebase编码自定义function来校验email和密码,如下;

Future<bool> loginCheck(ref) async {
  // loadingStart();
  try {
    final FirebaseAuth auth = FirebaseAuth.instance;
    await auth.signInWithEmailAndPassword(
      email: loginIdController.text,
      password: loginPassController.text,
    );
    // loadingEnd();
    return Future<bool>.value(true);
  } on FirebaseAuthException catch (e) {
      // print(e.code);
      //Do something
    } else if (e.code == 'network-request-failed') {
      //Do something
    } else {
      //Do something
      // loadingEnd();
    return Future<bool>.value(false);
  }

However, under FirebaseAuthException catch (e){} always error occurs like screen shot below.但是,在FirebaseAuthException catch (e){}下,总是会出现如下屏幕截图所示的错误。

在此处输入图像描述

I'm sorry that I'm very new about not only flutter/firebase but vscode, and could not detect the reason why I cannot catch the error appropriately.很抱歉,我不仅对 flutter/firebase 而且对 vscode 都很陌生,无法检测到无法正确捕获错误的原因。

Could someone advise me why this happen?有人可以告诉我为什么会这样吗? thanks for your kindness.谢谢你的好心。

The issue is that you have a breakpoint.问题是你有一个断点。 See the red circle on the side of the line the code crashed at.查看代码崩溃所在行一侧的红色圆圈。 Click it to remove it.单击它以将其删除。 They are used for debugging and checking the flow of your code它们用于调试和检查代码流

Also in the bottom left of the second screenshot you can see the breakpoint again and the options for catching breakpoints and errors.同样在第二个屏幕截图的左下角,您可以再次看到断点以及捕获断点和错误的选项。 Learn these too也学这些

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以指定如何处理 NodeCallback 中的错误吗<any,any> ?</any,any> - Can I specify how to handle an error in a NodeCallback<any,any>? 当收到来自 Firebase 的通知并且我打开了应用程序时,我该如何处理? - How can I handle a notification from Firebase when it arrives and I have the app open? 出现错误 - 无法解析“FirebaseAuthException”中的方法“getInstance” - Getting error - Cannot resolve method 'getInstance' in 'FirebaseAuthException' 我如何处理 Google Cloud Functions 中的机密? - How do i handle secrets in Google Cloud Functions? 如何处理 Maven MojoExecutionException? - How to handle Maven MojoExecutionException? 您如何让 Kube.netes 优雅地处理过多的 memory 使用而不是杀死 pod 或崩溃节点? - How can you make Kubernetes gracefully handle excessive memory usage instead of killing pods or crashing nodes? 如何使用 Java 的 SQS 扩展客户端库处理 AWS SQS 中的大型消息? - How do I handle large messages in AWS SQS using the SQS Extended Client Library for Java? 如何在本地处理运行 Google Cloud API Gateway 之类的东西? - How do I handle running things like Google Cloud API Gateway locally? 如何成功运行 npm 安装 - How can I run npm install succesfully 我如何在 firebase 中使用按日期排序 - How can i use order by date in firebase
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM