AlistGo/alist · error
e.Description
Error message
e.Description
What it means
The Yandex Disk driver surfaces the upstream API's error description verbatim: the HTTP response body parsed to an ApiError with a non-empty Error code that is not "UnauthorizedError". Whatever text Yandex returns in the Description field (e.g. "Couldn't find disk object" for DiskNotFoundError, quota messages for DiskResourceAlreadyExistsError) becomes the Go error. The literal message "e.Description" in logs means the error string itself came from the remote API.
Source
Thrown at drivers/yandex_disk/util.go:62
if resp != nil {
req.SetResult(resp)
}
var e ErrResp
req.SetError(&e)
res, err := req.Execute(method, u)
if err != nil {
return nil, err
}
//log.Debug(res.String())
if e.Error != "" {
if e.Error == "UnauthorizedError" {
err = d.refreshToken()
if err != nil {
return nil, err
}
return d.request(pathname, method, callback, resp)
}
return nil, errors.New(e.Description)
}
return res.Body(), nil
}
func (d *YandexDisk) getFiles(path string) ([]File, error) {
limit := 100
page := 1
res := make([]File, 0)
for {
offset := (page - 1) * limit
query := map[string]string{
"path": path,
"limit": strconv.Itoa(limit),
"offset": strconv.Itoa(offset),
}
if d.OrderBy != "" {
if d.OrderDirection == "desc" {
query["sort"] = "-" + d.OrderByView on GitHub (pinned to 843d9dc814)
Solutions
- Read the description text — it names the exact upstream cause (not-found, already-exists, quota, rate limit)
- For not-found: refresh the listing; the path was deleted, moved, or shared-permissions changed
- For rate-limit/maintenance descriptions: back off and retry with exponential delay
- If auth-related, re-run the OAuth flow so refreshToken() can succeed on the next 401
Defensive patterns
Strategy: try-catch
Try / catch
res, err := d.request(path, method, callback, &resp)
if err != nil {
msg := err.Error()
switch {
case strings.Contains(msg, "couldn't find"): // DiskNotFoundError
// refresh listing / treat as deleted
case strings.Contains(msg, "already exists"): // 409
// MakeDir idempotency: treat as success
case strings.Contains(msg, "too many requests"):
time.Sleep(time.Duration(rand.Intn(30)) * time.Second)
return d.request(path, method, callback, resp) // backoff retry
}
return nil, err
} Prevention
- Treat the error text as the upstream code's description and map known descriptions to recovery actions
- Refresh OAuth tokens proactively so UnauthorizedError handling stays effective
- Make MakeDir idempotent: map already-exists descriptions to success
- Back off on rate-limit descriptions instead of hammering
When it happens
Trigger: Any Yandex Disk REST call whose response body is {"error": "<code>", "description": "..."} with a code other than UnauthorizedError — 404 on missing path (DiskNotFoundError), 409 on existing folder (DiskResourceAlreadyExistsError), 400 bad parameters, 503 maintenance, rate limiting.
Common situations: Listing or linking a deleted/moved path; MakeDir on an existing name; expired OAuth token when the code isn't the unauthorized variant; Yandex API rate limits or maintenance windows; malformed path (leading/trailing slashes).
Related errors
- env.Errmsg
- chunkSize invalid
- oss: chunkNum invalid
- Too many parts, please increase part size
- access_token expired: provide a refresh_token together with
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/e14be31290102961.
Report an issue: GitHub.