Score:0

Error handling in Cloud functions - Cloud Logging

ni flag

I have a series of cloud functions and I want to get an alert when errors occur in them. I already have the alert set and it works.
I decided to use the Cloud Logging logs: functions.logger.error(Error ${error.message});
But for example when my function times out and I go to Logs Explorer I see these logs: "Function execution started" "Function execution took 4999 ms, finished with status: 'error' " or "Function execution took 4999 ms, finished with status: 'timeout' "
What should I do to handle those errors correctly? I tried to catch them but without good results. I would like to get a log with an ERROR severity (now their severity is DEBUG) in Cloud logging and therefore, get an alert sent to my email.
Thank you for your help.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.