summaryrefslogtreecommitdiff
path: root/internal/db/pg/util.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/db/pg/util.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/db/pg/util.go')
-rw-r--r--internal/db/pg/util.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/internal/db/pg/util.go b/internal/db/pg/util.go
deleted file mode 100644
index 17c09b720..000000000
--- a/internal/db/pg/util.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package pg
-
-import (
- "strings"
-
- "github.com/go-pg/pg/v10"
- "github.com/superseriousbusiness/gotosocial/internal/db"
-)
-
-// processErrorResponse parses the given error and returns an appropriate DBError.
-func processErrorResponse(err error) db.Error {
- switch err {
- case nil:
- return nil
- case pg.ErrNoRows:
- return db.ErrNoEntries
- case pg.ErrMultiRows:
- return db.ErrMultipleEntries
- default:
- if strings.Contains(err.Error(), "duplicate key value violates unique constraint") {
- return db.ErrAlreadyExists
- }
- return err
- }
-}