larksuite / larksuite/oapi-sdk-java

下载文件接口http状态码非200时报错,The result returned by the server is illegal

Open
#133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
310
Forks
115
PR merge metrics
No merged PRs in 30d

Description

版本:2.3.0
比如输入一个错误的file_token时就会抛出上面的异常
调用方法:client.drive().v1().file().download()

// file.java 第417行
DownloadFileResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, DownloadFileResp.class);
if (resp == null) {
    throw new IllegalArgumentException("The result returned by the server is illegal");
}

此时resp为null,接着就会抛出异常

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at file.java line 417 and trace client.drive().v1().file().download(), focusing on how UnmarshalRespUtil handles a non-200 response. Reproduce the problem with an invalid file_token and verify that the download path handles the server error without raising the generic illegal-result exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.