AlistGo/alist · error

error code is

Error message

error code is:%d

What it means

Returned by ChaoXing listFiles when /pc/resource/getResourceList answers with resp.Result != 1. The listing request (recType 1 for folders, 2 for files) was decoded but refused; only the numeric Result code is reported, not a message.

Solutions

  1. Confirm the bbsid by browsing the web client and copying the drive id from the URL
  2. Refresh storage login credentials and re-list
  3. If the root lists but a subfolder fails, the folder ID is stale — navigate from root again
  4. Report/patch the driver to include resp.Msg for actionable messages

Example fix

// before
msg := fmt.Sprintf("error code is:%d", resp.Result)
// after
msg := fmt.Sprintf("error code is:%d, msg: %s", resp.Result, resp.Msg)
Defensive patterns

Strategy: validation

Validate before calling

func validBbsid(id string) bool { return strings.TrimSpace(id) != "" }
if !validBbsid(d.Addition.Bbsid) { return errors.New("bbsid required") }

Try / catch

files, err := d.listFiles(parent)
if err != nil && strings.Contains(err.Error(), "error code is:") {
    // numeric only; re-login storage and retry once from root
}

Prevention

When it happens

Trigger: Listing with an invalid bbsid, a folderId that does not exist under that bbsid, or an expired session — Result is any value other than 1.

Common situations: Wrong bbsid pasted in the storage addition; course/drive deleted so every list call fails; cookies expired so business endpoints return Result != 1 instead of a transport error.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/4371b3a5fd1a9843. Report an issue: GitHub.

Appendix: source

Thrown at drivers/chaoxing/util.go:83

}

func (d *ChaoXing) GetFiles(parent string) ([]File, error) {
	files := make([]File, 0)
	query := map[string]string{
		"bbsid":    d.Addition.Bbsid,
		"folderId": parent,
		"recType":  "1",
	}
	var resp ListFileResp
	_, err := d.request("/pc/resource/getResourceList", http.MethodGet, func(req *resty.Request) {
		req.SetQueryParams(query)
	}, &resp)
	if err != nil {
		return nil, err
	}
	if resp.Result != 1 {
		msg := fmt.Sprintf("error code is:%d", resp.Result)
		return nil, errors.New(msg)
	}
	if len(resp.List) > 0 {
		files = append(files, resp.List...)
	}
	querys := map[string]string{
		"bbsid":    d.Addition.Bbsid,
		"folderId": parent,
		"recType":  "2",
	}
	var resps ListFileResp
	_, err = d.request("/pc/resource/getResourceList", http.MethodGet, func(req *resty.Request) {
		req.SetQueryParams(querys)
	}, &resps)
	if err != nil {
		return nil, err
	}
	for _, file := range resps.List {
		// 手机端超星上传的文件没有fileID字段,但ObjectID与fileID相同,可代替

View on GitHub (pinned to 843d9dc814)