简体   繁体   English

有没有办法在Firebase函数错误上添加一个钩子

[英]Is there a way to add a hook on Firebase functions error

I have a Firebase project with cloud functions and i'd like to be able to add a hook when there's an error (like sending a slack message with the error log). 我有一个具有云功能的Firebase项目,我希望能够在出现错误时添加一个钩子(例如发送带有错误日志的松弛消息)。

I think it's not possible because this is basic nodejs errors, but if someone knows a way, it would be nice to share it. 我认为这是不可能的,因为这是基本的nodejs错误,但是如果有人知道一种方法,最好将其共享。

Thanks 谢谢

It is not possible in function code. 在功能代码中是不可能的。 You should capture all errors in your function code and deal with them accordingly. 您应该捕获函数代码中的所有错误并进行相应处理。

You may also want to look into StackDriver and its notification options , which will let you view errors from functions in a more systematic way than just viewing the log in the console. 您可能还需要研究StackDriver及其通知选项 ,这将使您以更系统的方式查看功能中的错误,而不仅仅是在控制台中查看日志。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM