Skip to content

Conversation

CiCi503
Copy link
Collaborator

@CiCi503 CiCi503 commented Sep 29, 2019

No description provided.

@CiCi503 CiCi503 requested a review from rsonghuster September 29, 2019 09:05

before(async function () {
await createServiceAndFunction(client, serviceName, functionName, 'main.handler');
await client.publishVersion(serviceName, 'test version 1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么 publishVersion 的时候用的是 'test version 1',但 createAlias 的时候用的 versionId 是 '1',不需要对上么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'test version 1' 是 version 的 description,version 是自增的,不受用户指定。第一次发布的 versionId 就是 1

* @return {Promise} 返回 Object(包含 headers 和 data 属性[provisionConfig 信息])
*/
getProvisionConfig(serviceName, functionName, headers = {}, qualifier) {
getProvisionConfig(serviceName, functionName, qualifier, headers = {}, ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, 这个是新的接口, 之前的发布的npm 包还没有这个接口, headers 可以放在最后

之前有的老接口将 qualifier 放在后面, 是会怕给用户的函数 break change, 不能向下兼容

if (responseBody.ErrorMessage) {
errMsg = responseBody.ErrorMessage;
} else {
errMsg = responseBody.errorMessage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么会有这个大小写 message 的区别

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的 sdk 如果是 http function,errMessage 没有透传出来,被 sdk 吞掉了,因为 http function 的错误信息在 body 里是 errorMessage,而 sdk 里只拿了 ErrorMessage

runtime: 'nodejs6',
timeout: 10,
code: {
zipFile: fs.readFileSync(path.join(__dirname, 'figures/test.zip'), 'base64')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change 里面没有看到 test.zip?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,*.zip 在 .gitignore 里,test.zip 是 makefile 生成的

});
};

module.exports.http_function_err_handler = function (request, response, context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

�这个函数有啥错误呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数拼写错误,toSting()->toString()

@rsonghuster rsonghuster merged commit 35f12c5 into master Oct 12, 2019
CiCi503 pushed a commit that referenced this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants