Skip to content

Commit

Permalink
Disable Statsbeat when endpoint is not accesible (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorhdzg authored Mar 11, 2022
1 parent ebebcca commit cc20002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AutoCollection/Statsbeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit cc20002

Please sign in to comment.