Skip to content

Commit 25b7912

Browse files
committed
reverted telemetry connection error
1 parent 0e51243 commit 25b7912

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/telemetry/TelemetryEventClient.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"encoding/base64"
2222
"encoding/json"
23+
"errors"
2324
"fmt"
2425
cloudProviderIdentifier "github.com/devtron-labs/common-lib/cloud-provider-identifier"
2526
posthogTelemetry "github.com/devtron-labs/common-lib/telemetry"
@@ -692,7 +693,11 @@ func (impl *TelemetryEventClientImpl) checkForOptOut(ctx context.Context, UCID s
692693
impl.logger.Errorw("check opt-out list failed, rest api error", "ucid", UCID, "err", err)
693694
return false, err
694695
}
695-
flag := response["result"].(bool)
696+
flag, ok := response["result"].(bool)
697+
if !ok {
698+
impl.logger.Errorw("check opt-out list failed, type assertion error", "ucid", UCID)
699+
return false, errors.New("type assertion error")
700+
}
696701
return flag, nil
697702
}
698703

0 commit comments

Comments
 (0)