{"record":{"id":"adec8e369d573037","repo":"yudai/gotty","slug":"internal-server-error","errorCode":null,"errorMessage":"Internal Server Error","messagePattern":"Internal Server Error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/handlers.go","lineNumber":185,"sourceCode":"\n\treturn err\n}\n\nfunc (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {\n\ttitleVars := server.titleVariables(\n\t\t[]string{\"server\", \"master\"},\n\t\tmap[string]map[string]interface{}{\n\t\t\t\"server\": server.options.TitleVariables,\n\t\t\t\"master\": map[string]interface{}{\n\t\t\t\t\"remote_addr\": r.RemoteAddr,\n\t\t\t},\n\t\t},\n\t)\n\n\ttitleBuf := new(bytes.Buffer)\n\terr := server.titleTemplate.Execute(titleBuf, titleVars)\n\tif err != nil {\n\t\thttp.Error(w, \"Internal Server Error\", 500)\n\t\treturn\n\t}\n\n\tindexVars := map[string]interface{}{\n\t\t\"title\": titleBuf.String(),\n\t}\n\n\tindexBuf := new(bytes.Buffer)\n\terr = server.indexTemplate.Execute(indexBuf, indexVars)\n\tif err != nil {\n\t\thttp.Error(w, \"Internal Server Error\", 500)\n\t\treturn\n\t}\n\n\tw.Write(indexBuf.Bytes())\n}\n\nfunc (server *Server) handleAuthToken(w http.ResponseWriter, r *http.Request) {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/yudai/gotty/blob/a080c85cbc59226c94c6941ad8c395232d72d517/server/handlers.go#L167-L203","documentation":"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.","triggerScenarios":"Thrown at server/handlers.go:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the wrapped Execute error so 500s from title rendering are diagnosable","Pre-render or validate TitleFormat at startup (see the 'failed to fill window title template' path)","Fall back to a static title when template execution fails"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a080c85cbc59226c94c6941ad8c395232d72d517","analyzedAt":"2026-09-02T16:42:38.150Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}