{"record":{"id":"0fb8c27db99082cc","repo":"siyuan-note/siyuan","slug":"conf-language-0","errorCode":null,"errorMessage":"Conf.Language(0)","messagePattern":"Conf\\.Language\\(0\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/shortcuts.go","lineNumber":283,"sourceCode":"\tluteEngine := util.NewLute()\n\tluteEngine.SetHTMLTag2TextMark(true)\n\t_, tree := luteEngine.Md2BlockDOMTree(md, false)\n\tif nil == tree {\n\t\treturn \"\"\n\t}\n\tresetBlockIDsByTime(tree.Root, created)\n\treturn luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)\n}\n\n// createShorthandDocByDOM 创建速记文档，使用指定的 DOM 和文档块 ID（均基于速记输入时刻）。\n// 速记场景无需 tags、父文档、数学公式、剪藏链接等处理，直接基于 DOM 和指定 docID 落盘。\nfunc createShorthandDocByDOM(boxID, hPath, dom, docID string) (retID string, err error) {\n\tcreateDocLock.Lock()\n\tdefer createDocLock.Unlock()\n\n\tbox := Conf.Box(boxID)\n\tif nil == box {\n\t\terr = errors.New(Conf.Language(0))\n\t\treturn\n\t}\n\n\tFlushTxQueue()\n\tretID, err = createDocsByHPath(box.ID, hPath, dom, \"\", docID, false)\n\tif nil != err {\n\t\treturn\n\t}\n\tFlushTxQueue()\n\n\tbt := treenode.GetBlockTree(retID)\n\tif nil == bt {\n\t\tlogging.LogWarnf(\"get block tree by id [%s] failed after create\", retID)\n\t\treturn\n\t}\n\tbox.setSortByConf(path.Dir(bt.Path), retID)\n\n\tFlushTxQueue()","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/shortcuts.go#L265-L301","documentation":"Thrown by createShorthandDocByDOM when Conf.Box(boxID) returns nil, meaning no notebook with the given boxID is registered. Conf.Language(0) is the generic 'Query notebook failed' message. The function is the persistence path for shorthand (闪念速记) documents and aborts before any doc is written.","triggerScenarios":"The shorthand subsystem (called from shortcuts.go:117 and :185) hands a boxID that does not match any loaded notebook. Triggered when the configured shorthand target notebook was deleted, renamed at the config level, or when the workspace is opened with a different/conf/data set that no longer has that box.","commonSituations":"User deletes the notebook that was set as the shorthand inbox, then triggers a new shorthand. Sync or workspace switch left Conf.Box() unable to resolve the stored boxID. Mobile flash-capture fires before the notebook index is fully loaded at boot.","solutions":["Re-open Settings - Quick capture / Shorthand and reselect a valid target notebook so the stored boxID is corrected.","Restart the kernel so the notebook index is rebuilt and the boxID resolves again.","Verify the boxID passed in actually exists via the notebook list before capture (frontend should fall back to a default notebook)."],"exampleFix":"// before\nbox := Conf.Box(boxID) // nil after notebook deleted -> error\n// after (defensive caller)\nbox := Conf.Box(boxID)\nif box == nil {\n    boxID = defaultShorthandBoxID() // pick a valid fallback\n    box = Conf.Box(boxID)\n}","handlingStrategy":"validation","validationCode":"// Go: confirm the notebook exists before creating the shorthand doc\nif Conf.Box(boxID) == nil {\n    return \"\", fmt.Errorf(\"notebook %s not found, reselect shorthand target\", boxID)\n}","typeGuard":"// Go helper\nfunc notebookExists(boxID string) bool { return Conf.Box(boxID) != nil }","tryCatchPattern":null,"preventionTips":["After deleting a notebook, clear or migrate any shorthand/quick-capture target pointing at it.","On boot, validate persisted shorthand boxID against the current notebook list.","Surface a clear 'notebook missing' message in the capture UI instead of letting the generic error bubble."],"tags":["notebook","shorthand","quick-capture","i18n","kernel"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}