From 1f185f329bb82c87b250fb2312ae873d69a20d38 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 22 Mar 2025 13:59:00 +0800 Subject: Use a custom errPage500 --- http_handle_repo_contrib_index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'http_handle_repo_contrib_index.go') diff --git a/http_handle_repo_contrib_index.go b/http_handle_repo_contrib_index.go index af3f8b6..caffbe9 100644 --- a/http_handle_repo_contrib_index.go +++ b/http_handle_repo_contrib_index.go @@ -24,7 +24,7 @@ func httpHandleRepoContribIndex(writer http.ResponseWriter, request *http.Reques "SELECT id, COALESCE(title, 'Untitled'), status FROM merge_requests WHERE repo_id = $1", params["repo_id"], ); err != nil { - http.Error(writer, "Error querying merge requests: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error querying merge requests: "+err.Error()) return } defer rows.Close() @@ -33,13 +33,13 @@ func httpHandleRepoContribIndex(writer http.ResponseWriter, request *http.Reques var mrID int var mrTitle, mrStatus string if err = rows.Scan(&mrID, &mrTitle, &mrStatus); err != nil { - http.Error(writer, "Error scanning merge request: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error scanning merge request: "+err.Error()) return } result = append(result, idTitleStatus{mrID, mrTitle, mrStatus}) } if err = rows.Err(); err != nil { - http.Error(writer, "Error ranging over merge requests: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error ranging over merge requests: "+err.Error()) return } params["merge_requests"] = result -- cgit v1.2.3