Skip to content

Commit 752f2f5

Browse files
authored
feat: ✨ 针对accountid异常做出友好提示 (#984)
1 parent b570168 commit 752f2f5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/entry-public-method/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export default class EntryPublicMethod {
4343
// 处理密钥
4444
if (getSecretKey) {
4545
inputs.credentials = await getCredentials(inputs.credentials, inputs.project?.access);
46+
if (_.isEmpty(inputs.credentials?.AccountID)) {
47+
const access = inputs.project?.access;
48+
const tip = `请使用 s config add --AccountID xxxxx --AccessKeyID xxxxx --AccessKeySecret xxxxx --access ${access || 'default'} -f 强制覆盖旧的密钥,然后重试一次
49+
Please use "s config add --AccountID xxxxx --AccessKeyID xxxxx --AccessKeySecret xxxxx --access ${access || 'default'} -f" to force overwrite the old key, then try again.`;
50+
throw new core.CatchableError('Account id not obtained', tip);
51+
}
4652
}
4753

4854
setDefaultValue(inputs);
@@ -63,6 +69,12 @@ export default class EntryPublicMethod {
6369
}));
6470
}
6571

72+
// fc组件镜像 trim 左右空格
73+
const image = _.get(inputs, 'props.function.customContainerConfig.image');
74+
if (!_.isEmpty(image)) {
75+
_.set(inputs, 'props.function.customContainerConfig.image', _.trim(image));
76+
}
77+
6678
await InfraAsTemplate.modifyInputs(inputs); // 多环境处理
6779

6880
try {

0 commit comments

Comments
 (0)