mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 18:10:49 +09:00
GO-5344: Suppress expected error
This commit is contained in:
parent
b33c669bac
commit
4ef6b6c3bc
2 changed files with 9 additions and 4 deletions
|
@ -218,9 +218,10 @@ func (s *service) Close(ctx context.Context) error {
|
|||
|
||||
s.componentCtxCancel()
|
||||
|
||||
err = errors.Join(err,
|
||||
s.crossSpaceSubService.Unsubscribe(allChatsSubscriptionId),
|
||||
)
|
||||
unsubErr := s.crossSpaceSubService.Unsubscribe(allChatsSubscriptionId)
|
||||
if !errors.Is(err, crossspacesub.ErrSubscriptionNotFound) {
|
||||
err = errors.Join(err, unsubErr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@ var log = logging.Logger(CName).Desugar()
|
|||
|
||||
const CName = "core.subscription.crossspacesub"
|
||||
|
||||
var (
|
||||
ErrSubscriptionNotFound = fmt.Errorf("subscription not found")
|
||||
)
|
||||
|
||||
type Service interface {
|
||||
app.ComponentRunnable
|
||||
Subscribe(req subscriptionservice.SubscribeRequest) (resp *subscriptionservice.SubscribeResponse, err error)
|
||||
|
@ -110,7 +114,7 @@ func (s *service) Unsubscribe(subId string) error {
|
|||
|
||||
sub, ok := s.subscriptions[subId]
|
||||
if !ok {
|
||||
return fmt.Errorf("subscription not found")
|
||||
return ErrSubscriptionNotFound
|
||||
}
|
||||
|
||||
err := sub.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue