Skip to content

Commit

Permalink
Fix the problem of not being able to delete if storage was deleted
Browse files Browse the repository at this point in the history
Signed-off-by: JohnNiang <[email protected]>
  • Loading branch information
JohnNiang committed Oct 28, 2024
1 parent aaac41e commit f7a243c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ public Mono<Attachment> delete(DeleteContext deleteContext) {
})
.flatMap(result -> {
if (!Objects.equals(OK.value(), result.getCode())) {
// According to https://alist.nn.ci/guide/api/fs.html, we have no
// better way to detect whether the storage is not found
if (StringUtils.startsWith(
result.getMessage(), "failed get storage: storage not found"
)) {
// ignore error: storage not found
return Mono.just(attachment);
}
return Mono.error(new ServerWebInputException(
"Failed to delete file: " + result.getMessage())
);
Expand Down

0 comments on commit f7a243c

Please sign in to comment.