Skip to content

Commit 0ec9621

Browse files
committed
check request error during (Un)Subscribe completion
1 parent 77b3aaf commit 0ec9621

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,12 @@ func (c *client) Unsubscribe(ctx context.Context, topicFilters []string, props *
361361
case result = <-req.result:
362362
}
363363

364+
if req.err != nil {
365+
return nil, req.err
366+
}
367+
364368
if unsuback, ok := result.(*UnsubAck); ok {
365-
return unsuback, req.err
369+
return unsuback, nil
366370
}
367371

368372
return nil, fmt.Errorf("error during UNSUBSCRIBE, invalid typs received")

0 commit comments

Comments
 (0)