From edc30e6d36b51f73d2db31e6fbc55f86e8ca451f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 23:18:30 +0800 Subject: web: Separate HTTP error pages into its own package --- http_handle_repo_index.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'http_handle_repo_index.go') 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 } -- cgit v1.2.3