{"record":{"id":"415ae173cb937062","repo":"AlistGo/alist","slug":"file-does-not-exist","errorCode":null,"errorMessage":"file does not exist","messagePattern":"file does not exist","errorType":"exception","errorClass":"ErrFileNotExist","httpStatus":null,"severity":"error","filePath":"drivers/lanzou/types.go","lineNumber":12,"sourceCode":"package lanzou\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/alist-org/alist/v3/internal/model\"\n\t\"github.com/alist-org/alist/v3/pkg/utils\"\n\t\"time\"\n)\n\nvar ErrFileShareCancel = errors.New(\"file sharing cancellation\")\nvar ErrFileNotExist = errors.New(\"file does not exist\")\nvar ErrCookieExpiration = errors.New(\"cookie expiration\")\n\ntype RespText[T any] struct {\n\tText T `json:\"text\"`\n}\n\ntype RespInfo[T any] struct {\n\tInfo T `json:\"info\"`\n}\n\nvar _ model.Obj = (*FileOrFolder)(nil)\nvar _ model.Obj = (*FileOrFolderByShareUrl)(nil)\n\ntype FileOrFolder struct {\n\tName string `json:\"name\"`\n\t//Onof        string `json:\"onof\"` // 是否存在提取码\n\t//IsLock      string `json:\"is_lock\"`\n\t//IsCopyright int    `json:\"is_copyright\"`","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/types.go#L1-L30","documentation":"Sentinel error ErrFileNotExist in the lanzou driver, set in getShareUrlHtml (util.go:332-334) when the share page HTML contains \"文件不存在\" (file does not exist). The shareID is valid syntactically but the target file is gone — deleted by the owner before or after sharing. Downstream code (e.g. refresh flows) uses errors.Is on this sentinel to decide whether to drop cached objects.","triggerScenarios":"GET {ShareUrl}/{shareID} page body contains 文件不存在: file deleted from the uploader's lanzou account, wrong shareID typed/pasted, or the share was purged after a takedown.","commonSituations":"Stale cached alist link pointing at a removed file; user typo in shareID; uploader re-uploaded under a new link.","solutions":["Handle with errors.Is(err, ErrFileNotExist) and report a 404-style message; drop the object from any local cache","Ask the owner for the new share link if the content was re-uploaded","Double-check the shareID/URL for typos or truncated copy-paste"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isFileNotExist(err error) bool { return errors.Is(err, lanzou.ErrFileNotExist) }","tryCatchPattern":"if err != nil {\n\tif errors.Is(err, lanzou.ErrFileNotExist) {\n\t\t// drop from cache, return a 404-equivalent\n\t\tcache.Delete(shareID)\n\t\treturn nil, errs.ObjectNotFound\n\t}\n\treturn nil, err\n}","preventionTips":["Use the sentinel to prune dead entries from local link caches","Surface 'file removed' messaging instead of generic errors so users stop retrying dead links"],"tags":["lanzou","share-link","sentinel-error","driver","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}