You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/05/16 15:05:55 UTC

[plc4x] branch develop updated: fix(plc4go/spi): don't panic if sub handle is not found

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4c7691680d fix(plc4go/spi): don't panic if sub handle is not found
4c7691680d is described below

commit 4c7691680d21c4caaab68a31ae284c02dc85fad2
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue May 16 17:05:44 2023 +0200

    fix(plc4go/spi): don't panic if sub handle is not found
---
 plc4go/spi/model/DefaultPlcSubscriptionResponse.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plc4go/spi/model/DefaultPlcSubscriptionResponse.go b/plc4go/spi/model/DefaultPlcSubscriptionResponse.go
index 2c43930e7c..7b8a8c0fdc 100644
--- a/plc4go/spi/model/DefaultPlcSubscriptionResponse.go
+++ b/plc4go/spi/model/DefaultPlcSubscriptionResponse.go
@@ -21,6 +21,7 @@ package model
 
 import (
 	"github.com/pkg/errors"
+	"github.com/rs/zerolog/log"
 
 	apiModel "github.com/apache/plc4x/plc4go/pkg/api/model"
 )
@@ -44,7 +45,8 @@ func NewDefaultPlcSubscriptionResponse(request apiModel.PlcSubscriptionRequest,
 	for subscriptionTagName, consumers := range request.(*DefaultPlcSubscriptionRequest).preRegisteredConsumers {
 		subscriptionHandle, err := plcSubscriptionResponse.GetSubscriptionHandle(subscriptionTagName)
 		if subscriptionHandle == nil || err != nil {
-			panic("PlcSubscriptionHandle for " + subscriptionTagName + " not found")
+			log.Error().Msgf("PlcSubscriptionHandle for %s not found", subscriptionTagName)
+			continue
 		}
 		for _, consumer := range consumers {
 			subscriptionHandle.Register(consumer)