[英]trying to handle firebase storage exception doesn't work (flutter)
After creating the reference to my file on firebase storage I'm getting it's download URL.在 firebase 存储上创建对我的文件的引用后,我正在下载 URL。 Since the file(image) may or may not exist I'm using then and catch error .由于文件(图像)可能存在也可能不存在,因此我正在使用then并捕获错误。 However it still throws exception.但是它仍然抛出异常。 Even the try and catch block doesn't work.即使是 try and catch 块也不起作用。
StorageReference dpRef = FirebaseStorage.instance.ref().child(
'dp/' + widget.userId,
);
dpRef.getDownloadURL().then(
(value) {
setState(
() {
_dpImgURL = value;
},
);
},
).catchError((e) {
print(e.toString());
});
What am I doing wrong?我究竟做错了什么? New to flutter, so please be gentle. flutter 的新手,所以请温柔。
try catch is not working for firebase storage, no idea why, i fixed like this: try catch 不适用于 firebase 存储,不知道为什么,我这样修复:
}, onError: (e) {
debugPrint('Exception::: ==========>>>>>>> ${e.toString()}');
status(null);
});
it gets the exception vey well它很好地得到了异常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.