fix: Qiniu上传失败消息带HTTP状态码和具体错误

This commit is contained in:
mediabot-pt
2026-07-01 12:57:26 +08:00
parent 2d1a39691d
commit 4aab1a74a5

View File

@@ -68,8 +68,9 @@ public class QiniuStorageService implements StorageService {
uploadManager.put(content.getBytes(), path, auth.uploadToken(bucket)); uploadManager.put(content.getBytes(), path, auth.uploadToken(bucket));
log.debug("Qiniu 上传: {}", path); log.debug("Qiniu 上传: {}", path);
} catch (QiniuException e) { } catch (QiniuException e) {
log.error("Qiniu 上传失败 {}: {}", path, e.response != null ? e.response.error : e.getMessage()); String detail = e.response != null ? "code=" + e.response.statusCode + " " + e.response.error : e.getMessage();
throw new RuntimeException("Qiniu upload failed: " + path, e); log.error("Qiniu 上传失败 {}: {}", path, detail, e);
throw new RuntimeException("Qiniu upload failed: " + path + " (" + detail + ")", e);
} }
} }