AlistGo/alist · error
e.Code + ": " + e.Message
Error message
e.Code + ": " + e.Message
What it means
Returned by request() in the Aliyundrive Share driver for any API error whose Code is not AccessTokenInvalid or ShareLinkTokenInvalid (those two trigger automatic token refresh and retry). The error string concatenates the server's Code and Message.
Source
Thrown at drivers/aliyundrive_share/util.go:90
req.SetBody("{}")
}
resp, err := req.Execute(method, url)
if err != nil {
return nil, err
}
if e.Code != "" {
if e.Code == "AccessTokenInvalid" || e.Code == "ShareLinkTokenInvalid" {
if e.Code == "AccessTokenInvalid" {
err = d.refreshToken()
} else {
err = d.getShareToken()
}
if err != nil {
return nil, err
}
return d.request(url, method, callback)
} else {
return nil, errors.New(e.Code + ": " + e.Message)
}
}
return resp.Body(), nil
}
func (d *AliyundriveShare) getFiles(fileId string) ([]File, error) {
files := make([]File, 0)
data := base.Json{
"image_thumbnail_process": "image/resize,w_160/format,jpeg",
"image_url_process": "image/resize,w_1920/format,jpeg",
"limit": 200,
"order_by": d.OrderBy,
"order_direction": d.OrderDirection,
"parent_file_id": fileId,
"share_id": d.ShareId,
"video_thumbnail_process": "video/snapshot,t_1000,f_jpg,ar_auto,w_300",
"marker": "first",
}View on GitHub (pinned to 843d9dc814)
Solutions
- Read the Code prefix in the message: NotFound.* means bad share_id/folder; *Invalid means token problem; rate-limit codes mean slow down
- Re-open the share link in a browser to confirm it is still alive; re-create the storage with a fresh link if not
- Update alist to the latest version so newly recognized error codes are handled
- For persistent Invalid codes, clear and re-enter share_id/share_pwd in the driver config
Defensive patterns
Strategy: try-catch
Try / catch
body, err := d.request(url, method, cb)
if err != nil {
if strings.Contains(err.Error(), "AccessTokenInvalid") || strings.Contains(err.Error(), "ShareLinkTokenInvalid") { /* driver already retries once; force storage refresh */ }
return err
} Prevention
- Map known Codes to user-facing guidance in your wrapper
- Do not retry non-token errors blindly; most Codes are permanent conditions
- Monitor for new error codes after provider API changes
When it happens
Trigger: Any share API call (listing files via getFiles, etc.) that returns a structured error other than the two recoverable token codes — e.g. NotFound.Resource, ShareLink.Cancelled, permission errors, or rate limits.
Common situations: Browsing a share whose link was revoked; the share token expired mid-session with a code outside the retry list; API changes introduced new error codes not handled by the auto-refresh branch.
Related errors
- e.Message
- {e.Message}
- [doubao] API error (code: %d): %s
- failed to get share link information: %w
- dynamic: fmt.Errorf(info) - message passthrough from API 'in
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/178d7402f66c19cc.
Report an issue: GitHub.