From d7889bf3eab55f56d2ca94c462ca130fde705871 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Feb 2025 19:05:22 +0800 Subject: http_handle_*.go: Fix http.Error calls Previously when I was converting the fmt.Fprintln calls into http.Error, there was a mistake in my sed command which caused some of the messages to have double colons. This should fix them. --- http_handle_repo_log.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'http_handle_repo_log.go') diff --git a/http_handle_repo_log.go b/http_handle_repo_log.go index bdc0d78..72943be 100644 --- a/http_handle_repo_log.go +++ b/http_handle_repo_log.go @@ -11,26 +11,26 @@ func handle_repo_log(w http.ResponseWriter, r *http.Request, params map[string]a group_name, repo_name, ref_name := params["group_name"].(string), params["repo_name"].(string), params["ref"].(string) repo, description, err := open_git_repo(r.Context(), group_name, repo_name) if err != nil { - http.Error(w, "Error opening repo:: "+err.Error(), http.StatusInternalServerError) + http.Error(w, "Error opening repo: "+err.Error(), http.StatusInternalServerError) return } params["repo_description"] = description ref, err := repo.Reference(plumbing.NewBranchReferenceName(ref_name), true) if err != nil { - http.Error(w, "Error getting repo reference:: "+err.Error(), http.StatusInternalServerError) + http.Error(w, "Error getting repo reference: "+err.Error(), http.StatusInternalServerError) return } ref_hash := ref.Hash() commits, err := get_recent_commits(repo, ref_hash, -1) if err != nil { - http.Error(w, "Error getting recent commits:: "+err.Error(), http.StatusInternalServerError) + http.Error(w, "Error getting recent commits: "+err.Error(), http.StatusInternalServerError) return } params["commits"] = commits err = templates.ExecuteTemplate(w, "repo_log", params) if err != nil { - http.Error(w, "Error rendering template:: "+err.Error(), http.StatusInternalServerError) + http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError) return } } -- cgit v1.2.3