fix: catch all timeouts

This commit is contained in:
WebStreamr 2025-09-01 14:26:21 +00:00
parent 2468fbde4e
commit b47a512587
No known key found for this signature in database

View file

@ -42,7 +42,10 @@ export const logErrorAndReturnNiceString = (ctx: Context, logger: winston.Logger
return '🚦 Too many recent timeouts. Please try again later.';
}
if (error instanceof TimeoutError) {
if (
error instanceof TimeoutError
|| (error instanceof DOMException && error.name === 'TimeoutError') // sometimes this gets through, no idea why..
) {
logger.warn(`${source}: Request timed out.`, ctx);
return '🐢 Request timed out.';