v0.0.248 exerr in wmo package
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 55s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 55s
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/bson/bsontype"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
ct "gogs.mikescher.com/BlackForestBytes/goext/cursortoken"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"reflect"
|
||||
)
|
||||
@@ -66,21 +67,25 @@ func (c *Coll[TData]) Indexes() mongo.IndexView {
|
||||
}
|
||||
|
||||
func (c *Coll[TData]) Drop(ctx context.Context) error {
|
||||
return c.coll.Drop(ctx)
|
||||
err := c.coll.Drop(ctx)
|
||||
if err != nil {
|
||||
return exerr.Wrap(err, "failed to drop collection").Str("collection", c.Name()).Build()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Coll[TData]) createToken(fieldPrimary string, dirPrimary ct.SortDirection, fieldSecondary *string, dirSecondary *ct.SortDirection, lastEntity TData, pageSize *int) (ct.CursorToken, error) {
|
||||
|
||||
valuePrimary, err := c.getFieldValueAsTokenString(lastEntity, fieldPrimary)
|
||||
if err != nil {
|
||||
return ct.CursorToken{}, err
|
||||
return ct.CursorToken{}, exerr.Wrap(err, "failed to get (primary) field-value as token-string").Type("lastEntity", lastEntity).Str("fieldPrimary", fieldPrimary).Build()
|
||||
}
|
||||
|
||||
valueSeconary := ""
|
||||
if fieldSecondary != nil && dirSecondary != nil {
|
||||
valueSeconary, err = c.getFieldValueAsTokenString(lastEntity, *fieldSecondary)
|
||||
if err != nil {
|
||||
return ct.CursorToken{}, err
|
||||
return ct.CursorToken{}, exerr.Wrap(err, "failed to get (secondary) field-value as token-string").Type("lastEntity", lastEntity).StrPtr("fieldSecondary", fieldSecondary).Build()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user