diff --git a/controller/eventService/Service.go b/controller/eventService/Service.go index 5c13102d4926f0246cf2c250fe009fa72de3ca9b..833ef9977e54d1bf9ba3da68d29177b676ebc492 100644 --- a/controller/eventService/Service.go +++ b/controller/eventService/Service.go @@ -10,6 +10,7 @@ import ( interfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/event" amqp "github.com/rabbitmq/amqp091-go" + "github.com/sirupsen/logrus" ) // EventService is used to setup a connection to a broker and publish events to topics. @@ -78,5 +79,7 @@ func (e *EventService) PublishEvent(topic string, event event.Event) error { // CloseConnection closes an exisiting connection. func (e *EventService) CloseConnection() { - e.connection.Close() + if err := e.connection.Close(); err != nil { + logrus.Error(err) + } } diff --git a/controller/nucleus/deviceWatcher.go b/controller/nucleus/deviceWatcher.go index 8eb0bb7a5f27500ed82c989cc23242e416e479bc..5f07e1613f36e26a357186ae34f0a8540653bec3 100644 --- a/controller/nucleus/deviceWatcher.go +++ b/controller/nucleus/deviceWatcher.go @@ -9,6 +9,7 @@ import ( "code.fbi.h-da.de/danet/gosdn/controller/nucleus/types" "code.fbi.h-da.de/danet/gosdn/forks/goarista/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi" + "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" ) @@ -62,7 +63,9 @@ func (d *DeviceWatcher) callSubscribe(device device.Device, opts *gnmi.Subscribe ctx := context.Background() ctx = context.WithValue(ctx, types.CtxKeyOpts, opts) - device.Transport().SubscribeInternal(ctx, handleSubscribeRepsonse) + if err := device.Transport().SubscribeInternal(ctx, handleSubscribeRepsonse); err != nil { + logrus.Error(err) + } } func handleSubscribeRepsonse(resp *gpb.SubscribeResponse) {