{"record":{"id":"dcece6e5e16b0c9d","repo":"AlistGo/alist","slug":"get-link-of-s-failed-w","errorCode":null,"errorMessage":"get link of %s failed: %w","messagePattern":"get link of (.+?) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/123_open/read.go","lineNumber":72,"sourceCode":"\tif file.IsDir() {\n\t\treturn nil, errs.LinkIsDir\n\t}\n\tif err := d.ensureToken(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\tfileID, err := parseFileID(file.GetID())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rawURL string\n\tif d.UseDirectLink {\n\t\trawURL, err = d.client.Link.URL(ctx, fileID)\n\t} else {\n\t\trawURL, err = d.client.File.DownloadInfo(ctx, fileID)\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get link of %s failed: %w\", file.GetName(), err)\n\t}\n\tif rawURL == \"\" {\n\t\treturn nil, errors.New(\"the server returned an empty download url\")\n\t}\n\n\tif d.PrivateKey != \"\" {\n\t\tif d.UID == 0 {\n\t\t\treturn nil, errors.New(\"uid is required when private_key is set\")\n\t\t}\n\t\tvalidDuration := time.Duration(d.ValidDuration) * time.Minute\n\t\tif validDuration <= 0 {\n\t\t\tvalidDuration = 30 * time.Minute\n\t\t}\n\t\trawURL, err = SignURL(rawURL, d.PrivateKey, d.UID, validDuration)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"sign direct link failed: %w\", err)\n\t\t}\n\t}","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/123_open/read.go#L54-L90","documentation":"Error \"get link of %s failed: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/123_open/read.go:72 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"}