如何使用Firebase有效处理错误? [英] How does or how can you effectively handle errors using firebase?

查看:137
本文介绍了如何使用Firebase有效处理错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读firebase文档,它使用的是非常多的异步代码。我想知道firebase是否在回调中抛出错误和/或传递错误数据。据我所知,文件没有提到它。
在此先感谢您的建议

I've been reading the firebase documentation and it is very much asynchronous code that is used. I wanted to know if firebase is throwing errors and/or passing error data in the callbacks. As far as I can tell, the documentation makes no mention of it. Thanks in advance for advice

推荐答案

Firebase目前不会产生开发人员可使用的错误被投掷的坏的投入)。目前,Firebase操作可以保证成功或者不会触发事件。在网络连接问题的情况下,Firebase将不会触发事件。这是预期的行为,因为Firebase旨在以离线模式工作,一旦连接重新建立,它就会自动加速。

Firebase doesn't produce developer-consumable errors at the moment (outside exceptions that are thrown for bad inputs). Currently Firebase operations are guaranteed to either succeed or never trigger events. In the case of network connectivity issues, Firebase will simply not trigger events. This is expected behaviour, as Firebase is designed to work in offline mode, and it will automatically bring you up to speed once a connection has been re-established.

请注意,在将来我们会抛出安全违规错误和其他错误类型的错误。用于捕获和处理这些错误的API尚未写入。

Note that in the future we will throw errors for security violations and possibly other error types. The API for catching and handling these errors has not been written yet.

这篇关于如何使用Firebase有效处理错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆