From cc200022d7ce77d9bb90afbb5a22281c16f5e665 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:17:44 -0800 Subject: [PATCH] Disable Statsbeat when endpoint is not accesible (#922) --- AutoCollection/Statsbeat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoCollection/Statsbeat.ts b/AutoCollection/Statsbeat.ts index 3556aeed..33aaead6 100644 --- a/AutoCollection/Statsbeat.ts +++ b/AutoCollection/Statsbeat.ts @@ -352,7 +352,7 @@ class Statsbeat { } private _handleNetworkError(error: Error) { - if (error && error.message && error.message.indexOf("UNREACH") > -1) { // Handle both EHOSTUNREACH and ENETUNREACH + if (error && error.message && (error.message.indexOf("UNREACH") > -1 || error.message.indexOf("ENOTFOUND") > -1)) { // Handle EHOSTUNREACH, ENETUNREACH and ENOTFOUND this.enable(false);// Disable Statsbeat as is possible SDK is running in private or restricted network } }