From a84f78f8aa748181f715eba5c4492c700aef30b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rich=CE=9Brd?= Date: Mon, 23 Sep 2024 09:12:02 -0400 Subject: [PATCH] fix_: remove unreachable code error message (#5845) --- _assets/generate_handlers/generate_handlers_template.txt | 8 +++----- protocol/messenger_handlers.go | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/_assets/generate_handlers/generate_handlers_template.txt b/_assets/generate_handlers/generate_handlers_template.txt index c7629ebf0..5384e2b73 100644 --- a/_assets/generate_handlers/generate_handlers_template.txt +++ b/_assets/generate_handlers/generate_handlers_template.txt @@ -21,12 +21,10 @@ func (m *Messenger) dispatchToHandler(messageState *ReceivedMessageState, protoB {{ range .}} case protobuf.ApplicationMetadataMessage_{{.EnumValue}}: return m.{{.MethodName}}(messageState, protoBytes, msg, filter{{ if .FromArchiveArg }}, fromArchive{{ end }}) - {{ end }} - default: - m.logger.Info("protobuf type not found", zap.String("type", string(msg.ApplicationLayer.Type))) - return errors.New("protobuf type not found") + {{ end }} } - return nil + m.logger.Info("protobuf type not found", zap.String("type", string(msg.ApplicationLayer.Type))) + return errors.New("protobuf type not found") } {{ range . }} diff --git a/protocol/messenger_handlers.go b/protocol/messenger_handlers.go index 6a6b0e830..3b6e10f73 100644 --- a/protocol/messenger_handlers.go +++ b/protocol/messenger_handlers.go @@ -264,12 +264,10 @@ func (m *Messenger) dispatchToHandler(messageState *ReceivedMessageState, protoB case protobuf.ApplicationMetadataMessage_COMMUNITY_SHARED_ADDRESSES_RESPONSE: return m.handleCommunitySharedAddressesResponseProtobuf(messageState, protoBytes, msg, filter) - - default: - m.logger.Info("protobuf type not found", zap.String("type", string(msg.ApplicationLayer.Type))) - return errors.New("protobuf type not found") + } - return nil + m.logger.Info("protobuf type not found", zap.String("type", string(msg.ApplicationLayer.Type))) + return errors.New("protobuf type not found") }