[chore] tidy + test timelines a bit better (#1865)

* [chore] tidy + test timelines a bit better

* thanks linter
This commit is contained in:
tobi 2023-06-04 18:55:30 +02:00 committed by GitHub
commit 97bc2e713a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 685 additions and 479 deletions

View file

@ -21,10 +21,10 @@ import (
"container/list"
"context"
"errors"
"fmt"
"codeberg.org/gruf/go-kv"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/log"
)
@ -129,7 +129,7 @@ func (t *timeline) prepareXBetweenIDs(ctx context.Context, amount int, behindID
t.items.data.Remove(e)
}
// We've got a proper db error.
return fmt.Errorf("prepareXBetweenIDs: db error while trying to prepare %s: %w", entry.itemID, err)
return gtserror.Newf("db error while trying to prepare %s: %w", entry.itemID, err)
}
entry.prepared = prepared
}