{"record":{"id":"210a34a53163243c","repo":"yudai/gotty","slug":"failed-to-parse-window-title-format-s","errorCode":null,"errorMessage":"failed to parse window title format `%s`","messagePattern":"failed to parse window title format `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/server.go","lineNumber":57,"sourceCode":"\tindexData, err := Asset(\"static/index.html\")\n\tif err != nil {\n\t\tpanic(\"index not found\") // must be in bindata\n\t}\n\tif options.IndexFile != \"\" {\n\t\tpath := homedir.Expand(options.IndexFile)\n\t\tindexData, err = ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to read custom index file at `%s`\", path)\n\t\t}\n\t}\n\tindexTemplate, err := template.New(\"index\").Parse(string(indexData))\n\tif err != nil {\n\t\tpanic(\"index template parse failed\") // must be valid\n\t}\n\n\ttitleTemplate, err := noesctmpl.New(\"title\").Parse(options.TitleFormat)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to parse window title format `%s`\", options.TitleFormat)\n\t}\n\n\tvar originChekcer func(r *http.Request) bool\n\tif options.WSOrigin != \"\" {\n\t\tmatcher, err := regexp.Compile(options.WSOrigin)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to compile regular expression of Websocket Origin: %s\", options.WSOrigin)\n\t\t}\n\t\toriginChekcer = func(r *http.Request) bool {\n\t\t\treturn matcher.MatchString(r.Header.Get(\"Origin\"))\n\t\t}\n\t}\n\n\treturn &Server{\n\t\tfactory: factory,\n\t\toptions: options,\n\n\t\tupgrader: &websocket.Upgrader{","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/yudai/gotty/blob/a080c85cbc59226c94c6941ad8c395232d72d517/server/server.go#L39-L75","documentation":"Wrapped noesctmpl parse error in Server.New: the --title-format template string is syntactically invalid (unclosed delimiters, bad verbs), so the window-title template cannot be compiled at startup. Distinguished from the sibling index template, which panics because it is embedded and always valid.","triggerScenarios":"Thrown at server/server.go:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the TitleFormat syntax (balanced {{ }} and valid template actions)","Validate the format string with a dry parse before shipping config","Consult Go text/template syntax; noesctmpl only disables HTML escaping, not the grammar"],"exampleFix":null,"handlingStrategy":"validation","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"}