fix: Fetch() masks JetStream errors as empty-queue when zero msgs arrive (archie)

Fixes #35
This commit is contained in:
archie committed 2026-07-27 04:37:17 +00:00
1 parent 03899171e6
commit 5045592d41
1 file changed
+3 -3
+3 -3
View File
@@ -159,11 +159,11 @@ func (c *Client) Fetch(ctx context.Context) (jetstream.Msg, error) {
if msg == nil {
continue
}
if err := batch.Error(); err != nil {
return nil, fmt.Errorf("nats fetch batch: %w", err)
}
return msg, nil
}
if err := batch.Error(); err != nil {
return nil, fmt.Errorf("nats fetch batch: %w", err)
}
return nil, nil
}