diff options
author | 2023-06-04 18:55:30 +0200 | |
---|---|---|
committer | 2023-06-04 18:55:30 +0200 | |
commit | 97bc2e713a6e5b2c25869b93f5232560d7110170 (patch) | |
tree | 62d76de2c489331413cd2d53a99e0daeb762efaa /internal/timeline/index.go | |
parent | [docs] Add Repology stats (#1859) (diff) | |
download | gotosocial-97bc2e713a6e5b2c25869b93f5232560d7110170.tar.xz |
[chore] tidy + test timelines a bit better (#1865)
* [chore] tidy + test timelines a bit better
* thanks linter
Diffstat (limited to 'internal/timeline/index.go')
-rw-r--r-- | internal/timeline/index.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/timeline/index.go b/internal/timeline/index.go index 2d556a3b2..993f7dc5d 100644 --- a/internal/timeline/index.go +++ b/internal/timeline/index.go @@ -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" ) @@ -136,7 +136,7 @@ func (t *timeline) indexXBetweenIDs(ctx context.Context, amount int, behindID st } if _, err := t.items.insertIndexed(ctx, entry); err != nil { - return fmt.Errorf("error inserting entry with itemID %s into index: %w", entry.itemID, err) + return gtserror.Newf("error inserting entry with itemID %s into index: %w", entry.itemID, err) } } @@ -237,7 +237,7 @@ func (t *timeline) IndexAndPrepareOne(ctx context.Context, statusID string, boos } if inserted, err := t.items.insertIndexed(ctx, postIndexEntry); err != nil { - return false, fmt.Errorf("IndexAndPrepareOne: error inserting indexed: %w", err) + return false, gtserror.Newf("error inserting indexed: %w", err) } else if !inserted { // Entry wasn't inserted, so // don't bother preparing it. @@ -246,7 +246,7 @@ func (t *timeline) IndexAndPrepareOne(ctx context.Context, statusID string, boos preparable, err := t.prepareFunction(ctx, t.timelineID, statusID) if err != nil { - return true, fmt.Errorf("IndexAndPrepareOne: error preparing: %w", err) + return true, gtserror.Newf("error preparing: %w", err) } postIndexEntry.prepared = preparable |