{"record":{"id":"31dc926c7488410c","repo":"AlistGo/alist","slug":"failed-to-list-directory-w-31dc92","errorCode":null,"errorMessage":"failed to list directory: %w","messagePattern":"failed to list directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/proton_drive/util.go","lineNumber":85,"sourceCode":"}\n\nfunc (d *ProtonDrive) searchByPath(ctx context.Context, fullPath string, isFolder bool) (*proton.Link, error) {\n\tif fullPath == \"/\" {\n\t\treturn d.protonDrive.RootLink, nil\n\t}\n\n\tcleanPath := strings.Trim(fullPath, \"/\")\n\tpathParts := strings.Split(cleanPath, \"/\")\n\n\tcurrentLink := d.protonDrive.RootLink\n\n\tfor i, part := range pathParts {\n\t\tisLastPart := i == len(pathParts)-1\n\t\tsearchForFolder := !isLastPart || isFolder\n\n\t\tentries, err := d.protonDrive.ListDirectory(ctx, currentLink.LinkID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to list directory: %w\", err)\n\n\t\t}\n\n\t\tfound := false\n\t\tfor _, entry := range entries {\n\t\t\t// entry.Name is already decrypted!\n\t\t\tif entry.Name == part && entry.IsFolder == searchForFolder {\n\t\t\t\tcurrentLink = entry.Link\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"path not found: %s (looking for part: %s)\", fullPath, part)\n\t\t}\n\t}\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/proton_drive/util.go#L67-L103","documentation":"Error \"failed to list directory: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/proton_drive/util.go:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}