From 5ba84bd8ee27a7716495b9634d072ef2f9c14564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 13 Nov 2023 16:45:00 +0100 Subject: [PATCH] =?UTF-8?q?v0.0.319=20fix=20error=20when=20findone=C3=83+p?= =?UTF-8?q?ipeline=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- goextVersion.go | 4 ++-- wmo/queryFindOne.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index 4fceb0f..f441fb7 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.318" +const GoextVersion = "0.0.319" -const GoextVersionTimestamp = "2023-11-13T15:34:58+0100" +const GoextVersionTimestamp = "2023-11-13T16:45:00+0100" diff --git a/wmo/queryFindOne.go b/wmo/queryFindOne.go index 25208f6..acd43a1 100644 --- a/wmo/queryFindOne.go +++ b/wmo/queryFindOne.go @@ -81,13 +81,13 @@ func (c *Coll[TData]) findOneInternal(ctx context.Context, filter bson.M, allowN if cursor.Next(ctx) { v, err := c.decodeSingle(ctx, cursor) if err != nil { - return nil, exerr.Wrap(err, "mongo-aggregation [find-one] failed").Any("pipeline", pipeline).Str("collection", c.Name()).Build() + return nil, exerr.Wrap(err, "mongo-aggregation [find-one] failed to decode results").Any("pipeline", pipeline).Str("collection", c.Name()).Build() } return &v, nil } else if allowNull { return nil, nil } else { - return nil, exerr.Wrap(err, "mongo-aggregation [find-one] failed").Any("pipeline", pipeline).Str("collection", c.Name()).Build() + return nil, exerr.Wrap(mongo.ErrNoDocuments, "mongo-aggregation [find-one] returned no documents").Any("pipeline", pipeline).Str("collection", c.Name()).Build() } } }