Log error responses when deleting proxy publishers / subscribers.

This commit is contained in:
Joachim Bauch 2022-08-30 16:02:07 +02:00
parent 1774d56d7d
commit 42a8aab307
No known key found for this signature in database
GPG Key ID: 77C1D22D53E15F02
1 changed files with 8 additions and 2 deletions

View File

@ -170,9 +170,12 @@ func (p *mcuProxyPublisher) Close(ctx context.Context) {
},
}
if _, err := p.conn.performSyncRequest(ctx, msg); err != nil {
if response, err := p.conn.performSyncRequest(ctx, msg); err != nil {
log.Printf("Could not delete publisher %s at %s: %s", p.proxyId, p.conn, err)
return
} else if response.Type == "error" {
log.Printf("Could not delete publisher %s at %s: %s", p.proxyId, p.conn, response.Error)
return
}
log.Printf("Delete publisher %s at %s", p.proxyId, p.conn)
@ -247,9 +250,12 @@ func (s *mcuProxySubscriber) Close(ctx context.Context) {
},
}
if _, err := s.conn.performSyncRequest(ctx, msg); err != nil {
if response, err := s.conn.performSyncRequest(ctx, msg); err != nil {
log.Printf("Could not delete subscriber %s at %s: %s", s.proxyId, s.conn, err)
return
} else if response.Type == "error" {
log.Printf("Could not delete subscriber %s at %s: %s", s.proxyId, s.conn, response.Error)
return
}
log.Printf("Delete subscriber %s at %s", s.proxyId, s.conn)