Skip to content

Commit 278aaaa

Browse files
committed
fix(cos): update too many bucket error msg
1 parent 2f9ce22 commit 278aaaa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/cos/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ export default class Cos {
131131
if (e.code === 'BucketAlreadyExists' || e.code === 'BucketAlreadyOwnedByYou') {
132132
console.log(`Bucket ${inputs.bucket} already exist.`);
133133
} else if (e.code === 'TooManyBuckets') {
134-
// TODO: 存储桶太多了,兼容特殊大账号情况,暂时不抛出错误
134+
// 存储桶太多了,就先查看是否存在,如果不存在再抛出错误
135135
const exist = await this.isBucketExist(inputs.bucket!);
136136
if (exist) {
137137
console.log(`Bucket ${inputs.bucket} already exist.`);
138138
return true;
139139
}
140+
throw constructCosError(`API_COS_putBucket`, err);
140141
} else {
141142
// 失败重试 1 次,如果再次出错,正常处理
142143
if (this.retryTimes < this.maxRetryTimes) {

0 commit comments

Comments
 (0)