yudai/gotty · error

Internal Server Error

Error message

Internal Server Error

What it means

Generic 500 body from handleIndex after the pre-parsed window title template fails to execute against per-request title variables — i.e. the same titleTemplate that failed for the WS path, but here only a plain Internal Server Error is sent with no detail logged, making the root cause silent.

Source

Thrown at server/handlers.go:185

	return err
}

func (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {
	titleVars := server.titleVariables(
		[]string{"server", "master"},
		map[string]map[string]interface{}{
			"server": server.options.TitleVariables,
			"master": map[string]interface{}{
				"remote_addr": r.RemoteAddr,
			},
		},
	)

	titleBuf := new(bytes.Buffer)
	err := server.titleTemplate.Execute(titleBuf, titleVars)
	if err != nil {
		http.Error(w, "Internal Server Error", 500)
		return
	}

	indexVars := map[string]interface{}{
		"title": titleBuf.String(),
	}

	indexBuf := new(bytes.Buffer)
	err = server.indexTemplate.Execute(indexBuf, indexVars)
	if err != nil {
		http.Error(w, "Internal Server Error", 500)
		return
	}

	w.Write(indexBuf.Bytes())
}

func (server *Server) handleAuthToken(w http.ResponseWriter, r *http.Request) {

View on GitHub (pinned to a080c85cbc)

Solutions

  1. Log the wrapped Execute error so 500s from title rendering are diagnosable
  2. Pre-render or validate TitleFormat at startup (see the 'failed to fill window title template' path)
  3. Fall back to a static title when template execution fails
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server/handlers.go:185 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of yudai/gotty@a080c85cbc (2026-09-02). Data as JSON: /api/errors/adec8e369d573037. Report an issue: GitHub.