Reusing broken HTTP connections #49

Closed
opened 2026-02-17 00:27:56 +00:00 by aniram · 0 comments
Owner

project.go: could not execute template due to write tcp [::1]:8000->[::1]:59113: write: broken pipeproject.go: critical error could not execute error template due to write tcp [::1]:8000->[::1]:59113: write: broken pipe2026/02/17 01:16:14 http: superfluous response.WriteHeader call from github.com/marinacompsci/cidadon/internal/handler.(*ProjectHandler).RenderProjectsByKeyword (project.go:208)

I suspect the various instances of the snippet below in ProjectHandler.RenderProjectsByKeyword is trying to execute the error template after the connection to the client has already been corrupted when trying to execute the previous template. Instead I should just log the error.

     if err := h.templ.ExecuteTemplate(w, "index", d); err != nil {
		fmt.Printf("project.go: could not execute template due to %v", err)
		if err := h.templ.ExecuteTemplate(w, "error", nil); err != nil {
			fmt.Printf("project.go: critical error could not execute error template due to %v", err)
			http.Error(w, "Something went wrong, try again", http.StatusInternalServerError)
		}
	}
project.go: could not execute template due to write tcp [::1]:8000->[::1]:59113: write: broken pipeproject.go: critical error could not execute error template due to write tcp [::1]:8000->[::1]:59113: write: broken pipe2026/02/17 01:16:14 http: superfluous response.WriteHeader call from github.com/marinacompsci/cidadon/internal/handler.(*ProjectHandler).RenderProjectsByKeyword (project.go:208) I suspect the various instances of the snippet below in ProjectHandler.RenderProjectsByKeyword is trying to execute the error template after the connection to the client has already been corrupted when trying to execute the previous template. Instead I should just log the error. ```go if err := h.templ.ExecuteTemplate(w, "index", d); err != nil { fmt.Printf("project.go: could not execute template due to %v", err) if err := h.templ.ExecuteTemplate(w, "error", nil); err != nil { fmt.Printf("project.go: critical error could not execute error template due to %v", err) http.Error(w, "Something went wrong, try again", http.StatusInternalServerError) } } ```
aniram added this to the 2026.1 milestone 2026-02-17 00:27:56 +00:00
aniram self-assigned this 2026-02-17 00:27:56 +00:00
aniram added reference fix/browser-issues-input-field 2026-02-17 21:18:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aniram/cidadon#49
No description provided.