aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_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_repo_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_repo_index.go')
-rw-r--r--http_handle_repo_index.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go
index d28311b..567f329 100644
--- a/http_handle_repo_index.go
+++ b/http_handle_repo_index.go
@@ -8,6 +8,7 @@ import (
"go.lindenii.runxiyu.org/forge/internal/git2c"
"go.lindenii.runxiyu.org/forge/internal/render"
+ "go.lindenii.runxiyu.org/forge/internal/web"
)
type commitDisplay struct {
@@ -27,14 +28,14 @@ func (s *Server) httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, p
client, err := git2c.NewClient(s.config.Git.Socket)
if err != nil {
- errorPage500(w, params, err.Error())
+ web.ErrorPage500(templates, w, params, err.Error())
return
}
defer client.Close()
commits, readme, err := client.Cmd1(repoPath)
if err != nil {
- errorPage500(w, params, err.Error())
+ web.ErrorPage500(templates, w, params, err.Error())
return
}