{"record":{"id":"f5413cf14af381f4","repo":"siyuan-note/siyuan","slug":"conf-language-15","errorCode":null,"errorMessage":"Conf.Language(15)","messagePattern":"Conf\\.Language\\(15\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/block.go","lineNumber":863,"sourceCode":"\t\t\t\theadingMode = \"0\"\n\t\t\t}\n\t\t\tembed.SetIALAttr(\"custom-heading-mode\", headingMode)\n\t\t}\n\t\tembed.AppendChild(&ast.Node{Type: ast.NodeBlockQueryEmbedScript, Tokens: []byte(\"select * from blocks where id='\" + defID + \"'\")})\n\t\toriginalRefNode.InsertBefore(embed)\n\t\toriginalRefNode.Unlink()\n\t}\n}\n\nfunc GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error) {\n\ttree, err := LoadTreeByBlockID(id)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tnode := treenode.GetNodeInTree(tree, id)\n\tif nil == node {\n\t\terr = fmt.Errorf(Conf.Language(15), id)\n\t\treturn\n\t}\n\n\tif ast.NodeHeading != node.Type {\n\t\treturn\n\t}\n\n\tvar nodes []*ast.Node\n\tnodes = append(nodes, node)\n\tnodes = append(nodes, treenode.HeadingChildren(node)...)\n\thiddenNodes := map[string]bool{}\n\tfor _, hidden := range treenode.CollectFoldHiddenNodes(node.Parent) {\n\t\thiddenNodes[hidden.ID] = true\n\t}\n\n\ttransaction = &Transaction{}\n\tluteEngine := util.NewLute()\n\tfor _, n := range nodes {","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/block.go#L845-L881","documentation":"This kernel code looks up a block by ID in a tree and, when the node is missing, fails with fmt.Errorf(Conf.Language(15), id) — a localized \"block [id] not found\" message. In the accessibility flow surfaced at app/electron/accessibility.js, the Electron main process catches this err value when reading the accessibility override file; a missing file (ENOENT) is treated as 'accessibility not configured' rather than a fatal failure.","triggerScenarios":"Passing a document/block id that no longer exists (block deleted, doc removed, ID mistyped) to the heading-related API at block.go:863; on the Electron side, the accessibility settings file not existing yet when getAccessibilityOverride reads it.","commonSituations":"Stale references kept after deleting blocks or notebooks; syncing conflicts removing blocks still referenced elsewhere; first launch before accessibility.js ever wrote its config file.","solutions":["Verify the block ID exists (e.g. via /api/query/sql or getBlockKramdown) before calling the API","Refresh/reopen the document so client-side references are current","For the accessibility file case, no action needed — ENOENT is handled as a default (disabled) state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const block = await api.getBlockByID(id);\nif (!block) throw new Error(`block ${id} not found; refresh document references`);","typeGuard":"function blockExists(b) {\n  return !!b && typeof b.id === \"string\" && b.id.length > 0;\n}","tryCatchPattern":"try {\n  const enabled = await getAccessibilityOverride();\n} catch (error) {\n  if (error.code === \"ENOENT\") {\n    return false; // not configured yet — default state\n  }\n  throw error;\n}","preventionTips":["Resolve block IDs from live query results, never from stale caches","Re-fetch references after deleting or syncing blocks","Treat missing accessibility config file as 'disabled' default, as the Electron code already does"],"tags":["block","not-found","localization","electron"],"backgroundTag":"resource-not-found","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}