mirror of https://github.com/halo-dev/halo
Fix the problem of deleting attachment on USS but failed (#2607)
#### What type of PR is this? /kind bug /area core /milestone 1.6.x #### What this PR does / why we need it: 修复又拍云附件删除成功,但是管理页面的“internal server error” 报警 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2603 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 修复又拍云附件删除成功仍旧提示错误的问题 ```pull/5661/head
parent
075d780ade
commit
d43190d74c
|
@ -138,11 +138,12 @@ public class UpOssFileHandler implements FileHandler {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Response result = manager.deleteFile(key, null);
|
Response result = manager.deleteFile(key, null);
|
||||||
HashMap respondBody = JsonUtils.jsonToObject(result.body().string(), HashMap.class);
|
if (result.code() != 200) {
|
||||||
if (!result.isSuccessful()
|
HashMap respondBody = JsonUtils.jsonToObject(result.body().string(), HashMap.class);
|
||||||
&& !(result.code() == 404 && respondBody.get("code").equals(40400001))) {
|
if (!(result.code() == 404 && respondBody.get("code").equals(40400001))) {
|
||||||
log.warn("附件 " + key + " 从又拍云删除失败");
|
log.warn("附件 " + key + " 从又拍云删除失败");
|
||||||
throw new FileOperationException("附件 " + key + " 从又拍云删除失败");
|
throw new FileOperationException("附件 " + key + " 从又拍云删除失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException | UpException e) {
|
} catch (IOException | UpException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue