How to catch hook timeout error?

(Devalnor) #1

Hi,

I create a registration chatbot flow that send data to a webhook.
During the test we got strange random timeout even if our server is ok.
When I check the log I have the ETIMEDOUT message.
The question is how to catch the error and notice the user with a message?
Actually it drop the flow without any response from the chatbot.

Thanks for your help,
Mx

(John Jackson) #2

Welcome to the community site!

A consistent time out usually means there is some sort of firewall issue, or the URL is not correctly formatted for some reason.

I’m not sure it’s a good idea to post your settings here in a public forum, but if the above doesn’t help if you could send a screenshot of your webhook setup to support@flowxo.com we’ll be able to take a closer look.

(Devalnor) #3

Hi John,

Thanks for you answer.
I found that the issue was an incompatibility with the emoji chars so I add a removeInvalidChars code that resolve it.

I share it here for those who have the same issue:

// Remove Emoji from a string

var string = inputs.string;
var ranges = [
  '\ud83c[\udf00-\udfff]', // U+1F300 to U+1F3FF
  '\ud83d[\udc00-\ude4f]', // U+1F400 to U+1F64F
  '\ud83d[\ude80-\udeff]'  // U+1F680 to U+1F6FF
];
var res= string.replace(new RegExp(ranges.join('|'), 'g'), '');
resolve(res);

However It would be nice to have to generate a 408 timeout error that can be interpreted by the flow instead of a simple abort.

(John Jackson) #4

I’m glad you figured it out. So was the connection actually hanging then, actually timing out?

(Devalnor) #5

Yes, in our case it seem that the server (or our firewall) don’t want to answer anything when there is emoji in a http post.