Skip to content

Commit

Permalink
Fix the problem of not being able to upload if folder doesn't exist (#27
Browse files Browse the repository at this point in the history
)

If the folder in AList doesn't exist, `failed get parent list: failed get dir: object not found` will be responded.

Fixes #24

/kind bug

```release-note
修复文件夹不存在时无法正常上传文件
```
  • Loading branch information
JohnNiang authored Oct 28, 2024
1 parent 3d787dc commit aaac41e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ private Mono<AListGetFileInfoRes> getFile(String token,
if (!Objects.equals(OK.value(), result.getCode())) {
if (ignoreNotFound
&& Objects.equals(INTERNAL_SERVER_ERROR.value(), result.getCode())
&& "object not found".equals(result.getMessage())) {
// According to https://alist.nn.ci/guide/api/fs.html, we have no better
// way to determine whether the file exists
&& StringUtils.endsWith(result.getMessage(), "object not found")) {
return Mono.empty();
}
return Mono.error(new ServerWebInputException(
Expand Down

0 comments on commit aaac41e

Please sign in to comment.