summaryrefslogtreecommitdiff
path: root/internal/db/error.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-09-12 13:03:23 +0200
committerLibravatar GitHub <noreply@github.com>2022-09-12 13:03:23 +0200
commit268f252e0d517f2693b30d03fb8a68a0764a43bc (patch)
tree95920c06bcdfc0ca11486aa08a547d85ca35f8ce /internal/db/error.go
parent[docs] unbreak standard css (#818) (diff)
downloadgotosocial-268f252e0d517f2693b30d03fb8a68a0764a43bc.tar.xz
[feature] Fetch + display custom emoji in statuses from remote instances (#807)
* start implementing remote emoji fetcher * update status where pk * aaa * tidy up a little * check size limits for emojis * thank you linter, i love you <3 * update swagger docs * add emoji dereference test * make emoji max sizes configurable * normalize db.ErrAlreadyExists
Diffstat (limited to 'internal/db/error.go')
-rw-r--r--internal/db/error.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/internal/db/error.go b/internal/db/error.go
index 9ac0b6aa0..8dc344360 100644
--- a/internal/db/error.go
+++ b/internal/db/error.go
@@ -28,19 +28,8 @@ var (
ErrNoEntries Error = fmt.Errorf("no entries")
// ErrMultipleEntries is returned when a caller expected ONE entry for a query, but multiples were found.
ErrMultipleEntries Error = fmt.Errorf("multiple entries")
+ // ErrAlreadyExists is returned when a conflict was encountered in the db when doing an insert.
+ ErrAlreadyExists Error = fmt.Errorf("already exists")
// ErrUnknown denotes an unknown database error.
ErrUnknown Error = fmt.Errorf("unknown error")
)
-
-// ErrAlreadyExists is returned when a caller tries to insert a database entry that already exists in the db.
-type ErrAlreadyExists struct {
- message string
-}
-
-func (e *ErrAlreadyExists) Error() string {
- return e.message
-}
-
-func NewErrAlreadyExists(msg string) error {
- return &ErrAlreadyExists{message: msg}
-}