diff --git a/packages/cli-plugin-fc/src/index.ts b/packages/cli-plugin-fc/src/index.ts index 94999074..8591962b 100644 --- a/packages/cli-plugin-fc/src/index.ts +++ b/packages/cli-plugin-fc/src/index.ts @@ -208,6 +208,16 @@ export class AliyunFCPlugin extends BasePlugin { this.getStore('artifactFile', 'global') || join(this.servicePath, 'serverless.zip'); + if (!syaml[access].AccountID) { + console.error( + 'Parse servrelessDevs config error, there is a high probability that ak error' + ); + this.core.debug('syaml', syaml); + throw new Error( + `ServerlessDevs AccountId corresponding to ${access} does not exist` + ); + } + const akId = Crypto.AES.decrypt( syaml[access].AccountID, 'SecretKey123' diff --git a/packages/cli-plugin-package/src/index.ts b/packages/cli-plugin-package/src/index.ts index 701ef7a5..2383d101 100644 --- a/packages/cli-plugin-package/src/index.ts +++ b/packages/cli-plugin-package/src/index.ts @@ -906,6 +906,14 @@ export class PackagePlugin extends BasePlugin { delete this.core.service.functions[functionName]; } }); + const notFoundFnuction = functions.filter(functoinName => { + return !this.core.service.functions[functoinName]; + }); + if (notFoundFnuction.length) { + throw new Error( + `The specified functions ${notFoundFnuction.join(', ')} do not exist.` + ); + } } async package() {