Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

chore: opti more error message #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/cli-plugin-fc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions packages/cli-plugin-package/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down