aboutsummaryrefslogtreecommitdiff
path: root/http_handle_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 23:18:30 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 23:18:30 +0800
commitedc30e6d36b51f73d2db31e6fbc55f86e8ca451f (patch)
tree5d15da4dc72b71e86f7293e51d12b29706e8889a /http_handle_index.go
parentRemove an unnecessary nolint:gochecknoglobals (diff)
downloadforge-edc30e6d36b51f73d2db31e6fbc55f86e8ca451f.tar.gz
forge-edc30e6d36b51f73d2db31e6fbc55f86e8ca451f.tar.zst
forge-edc30e6d36b51f73d2db31e6fbc55f86e8ca451f.zip
web: Separate HTTP error pages into its own package
Diffstat (limited to 'http_handle_index.go')
-rw-r--r--http_handle_index.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/http_handle_index.go b/http_handle_index.go
index a519a5a..a1ecfe4 100644
--- a/http_handle_index.go
+++ b/http_handle_index.go
@@ -8,6 +8,7 @@ import (
"runtime"
"github.com/dustin/go-humanize"
+ "go.lindenii.runxiyu.org/forge/internal/web"
)
// httpHandleIndex provides the main index page which includes a list of groups
@@ -18,7 +19,7 @@ func (s *Server) httpHandleIndex(writer http.ResponseWriter, request *http.Reque
groups, err = s.queryNameDesc(request.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL")
if err != nil {
- errorPage500(writer, params, "Error querying groups: "+err.Error())
+ web.ErrorPage500(templates, writer, params, "Error querying groups: "+err.Error())
return
}
params["groups"] = groups