From 3301148bb73a0f5f32c49417daed6d914c9ec05e Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Tue, 8 Feb 2022 12:17:53 +0100 Subject: merge fixup --- internal/processing/admin/emoji.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/processing') diff --git a/internal/processing/admin/emoji.go b/internal/processing/admin/emoji.go index bb9f4ecb5..6ef78aa65 100644 --- a/internal/processing/admin/emoji.go +++ b/internal/processing/admin/emoji.go @@ -20,6 +20,7 @@ package admin import ( "context" + "errors" "fmt" "io" @@ -55,7 +56,8 @@ func (p *processor) EmojiCreate(ctx context.Context, account *gtsmodel.Account, emoji, err := processingEmoji.LoadEmoji(ctx) if err != nil { - if err == db.ErrAlreadyExists { + var alreadyExistsError *db.ErrAlreadyExists + if errors.As(err, &alreadyExistsError) { return nil, gtserror.NewErrorConflict(fmt.Errorf("emoji with shortcode %s already exists", form.Shortcode), fmt.Sprintf("emoji with shortcode %s already exists", form.Shortcode)) } return nil, gtserror.NewErrorInternalError(fmt.Errorf("error loading emoji: %s", err), "error loading emoji") -- cgit v1.2.3