From 8e994edbde8447a1f0c665c6044bf249dd543dd8 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 2 Dec 2024 13:12:38 -0700 Subject: [PATCH] connector: only send UNKNOWN_ERROR if not pipe error Signed-off-by: Sumner Evans --- pkg/connector/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/connector/client.go b/pkg/connector/client.go index b522e499..e7c4a2fa 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -425,11 +425,12 @@ func (t *TelegramClient) onConnectionStateChange(reason string) func() { authStatus, err := t.client.Auth().Status(ctx) if err != nil { - t.sendUnknownError(err) if errors.Is(err, syscall.EPIPE) { // This is a pipe error, try reconnecting t.Disconnect() t.Connect(ctx) + } else { + t.sendUnknownError(err) } } else if authStatus.Authorized { t.userLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnected})