From e8776e785bc467bff47c759056b946c6573cbdd3 Mon Sep 17 00:00:00 2001 From: mark wu Date: Wed, 13 Dec 2023 21:10:02 +0800 Subject: [PATCH] Remove impossible error case --- internal/handler/controller/app_config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/handler/controller/app_config.go b/internal/handler/controller/app_config.go index f139fdd..602a8b8 100644 --- a/internal/handler/controller/app_config.go +++ b/internal/handler/controller/app_config.go @@ -1,7 +1,6 @@ package controller import ( - "errors" "fmt" "net/http" @@ -44,7 +43,7 @@ func (c *Controller) handleAppConfigSet(w http.ResponseWriter, r *http.Request) // Deactivated removed domains; added domains need manual activation. domains, err := tx.ListDomains(r.Context(), app.ID) - if err != nil && !errors.Is(err, models.ErrDomainNotFound) { + if err != nil { return nil, err } for _, d := range domains { @@ -60,7 +59,7 @@ func (c *Controller) handleAppConfigSet(w http.ResponseWriter, r *http.Request) log(r).Info("deleting domain", zap.String("domain", d.Domain)) } domainVerifications, err := tx.ListDomainVerifications(r.Context(), app.ID) - if err != nil && !errors.Is(err, models.ErrDomainNotFound) { + if err != nil { return nil, err } for _, d := range domainVerifications {