{"record":{"id":"96747359f01946e7","repo":"siyuan-note/siyuan","slug":"conf-language-30-err-error","errorCode":null,"errorMessage":"Conf.Language(30) {err.Error()}","messagePattern":"Conf\\.Language\\(30\\) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/repository.go","lineNumber":3000,"sourceCode":"type Backup struct {\n\tSize    int64  `json:\"size\"`\n\tHSize   string `json:\"hSize\"`\n\tUpdated string `json:\"updated\"`\n\tSaveDir string `json:\"saveDir\"` // 本地备份数据存放目录路径\n}\n\ntype Sync struct {\n\tSize      int64  `json:\"size\"`\n\tHSize     string `json:\"hSize\"`\n\tUpdated   string `json:\"updated\"`\n\tCloudName string `json:\"cloudName\"` // 云端同步数据存放目录名\n\tSaveDir   string `json:\"saveDir\"`   // 本地同步数据存放目录路径\n}\n\nfunc GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize, hTrafficAPIGet, hTrafficAPIPut string, err error) {\n\tstat, err := getCloudSpace()\n\tif err != nil {\n\t\terr = errors.New(Conf.Language(30) + \" \" + err.Error())\n\t\treturn\n\t}\n\n\tsyncSize := stat.Sync.Size\n\tsyncUpdated := stat.Sync.Updated\n\ts = &Sync{\n\t\tSize:    syncSize,\n\t\tHSize:   \"-\",\n\t\tUpdated: syncUpdated,\n\t}\n\n\tbackupSize := stat.Backup.Size\n\tbackupUpdated := stat.Backup.Updated\n\tb = &Backup{\n\t\tSize:    backupSize,\n\t\tHSize:   \"-\",\n\t\tUpdated: backupUpdated,\n\t}","sourceCodeStart":2982,"sourceCodeEnd":3018,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/repository.go#L2982-L3018","documentation":"The GetCloudSpace function queries the cloud provider for sync, backup, and asset storage usage statistics. When the underlying getCloudSpace call fails (network error, auth failure, or API error), the function wraps the error with Language(30) as a prefix and returns it. The error message combines a localized error label with the raw underlying error detail.","triggerScenarios":"Calling GetCloudSpace (typically from the Settings - Account & sync space usage display) when the cloud API is unreachable, returns an error, or the authentication token has expired. The function delegates to getCloudSpace which makes the actual HTTP request to the cloud provider.","commonSituations":"Network connectivity issues to the SiYuan cloud or third-party provider (WebDAV/S3). Expired login sessions where the auth token is no longer valid. Cloud provider maintenance or downtime. Also seen when the user has not logged in but the settings panel tries to load space statistics.","solutions":["Verify network connectivity to the cloud provider endpoint","Re-login to the SiYuan cloud account in Settings - Account if the token has expired","Check the kernel log for the detailed err.Error() component to identify the specific cloud API failure","If using WebDAV/S3, verify the server URL, credentials, and that the endpoint is responding"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check cloud connectivity before calling GetCloudSpace\nif model.Conf.Sync.Provider == 0 {\n    // no provider configured, skip space query\n    return\n}","typeGuard":null,"tryCatchPattern":"// Handle cloud space query failure gracefully\nstat, err := model.GetCloudSpace()\nif err != nil {\n    // show placeholder values instead of crashing the settings panel\n    hSize = \"-\"\n    hTotalSize = \"-\"\n    logging.LogErrorf(\"get cloud space failed: %s\", err)\n}","preventionTips":["Cache the last successful cloud space result and display it when the API fails","Add a timeout to the cloud space query to prevent the settings panel from hanging","Show placeholder dash values in the UI when the query fails rather than an error screen","Verify authentication status before querying cloud space"],"tags":["cloud","network","space","authentication"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}