From a612e4d8695f0ed4baed9f9661fda7b89eb0ad07 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 11 Jan 2024 23:10:15 +0100 Subject: [PATCH] Use httpError in groupHandler. --- webserver/webserver.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/webserver/webserver.go b/webserver/webserver.go index 377ce4c..3f5a6cf 100644 --- a/webserver/webserver.go +++ b/webserver/webserver.go @@ -328,13 +328,7 @@ func groupHandler(w http.ResponseWriter, r *http.Request) { g, err := group.Add(name, nil) if err != nil { - if os.IsNotExist(err) { - notFound(w) - } else { - log.Printf("group.Add: %v", err) - http.Error(w, "Internal server error", - http.StatusInternalServerError) - } + httpError(w, err) return }