diff --git a/mcu_proxy.go b/mcu_proxy.go index ac4da48..9c1047d 100644 --- a/mcu_proxy.go +++ b/mcu_proxy.go @@ -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)