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