@cloudbase/manager-node 4.4.6 → 4.4.7-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/constant.js CHANGED
@@ -47,7 +47,12 @@ exports.SCF_STATUS = {
47
47
  ACTIVE: 'Active',
48
48
  CREATING: 'Creating',
49
49
  UPDATING: 'Updating',
50
- CREATE_FAILED: 'CreateFailed'
50
+ CREATE_FAILED: 'CreateFailed',
51
+ UPDATE_FAILED: 'UpdateFailed',
52
+ PUBLISHING: 'Publishing',
53
+ PUBLISH_FAILED: 'PublishFailed',
54
+ DELETING: 'Deleting',
55
+ DELETE_FAILED: 'DeleteFailed'
51
56
  };
52
57
  // 是否使用内网域名
53
58
  exports.USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT" in process.env;
@@ -995,12 +995,15 @@ class FunctionService {
995
995
  }, 300000);
996
996
  ticker = setInterval(async () => {
997
997
  try {
998
- const { Status } = await this.getFunctionDetail(funcName, codeSecret);
998
+ const { Status, StatusDesc, StatusReasons } = await this.getFunctionDetail(funcName, codeSecret);
999
999
  // 更新中
1000
1000
  if (Status === constant_1.SCF_STATUS.CREATING || Status === constant_1.SCF_STATUS.UPDATING)
1001
1001
  return;
1002
1002
  // 创建失败
1003
1003
  if (Status === constant_1.SCF_STATUS.CREATE_FAILED) {
1004
+ StatusDesc && console.log(`函数状态描述: ${StatusDesc}`);
1005
+ const errorDetails = StatusReasons.map(item => `[${item.ErrorCode}] ${item.ErrorMessage}`).join('\n');
1006
+ console.error(`函数创建失败信息: ${errorDetails}`);
1004
1007
  throw new error_1.CloudBaseError('云函数创建失败');
1005
1008
  }
1006
1009
  // 函数状态正常
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/manager-node",
3
- "version": "4.4.6",
3
+ "version": "4.4.7-beta.0",
4
4
  "description": "The node manage service api for cloudbase.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -34,6 +34,11 @@ export declare const SCF_STATUS: {
34
34
  CREATING: string;
35
35
  UPDATING: string;
36
36
  CREATE_FAILED: string;
37
+ UPDATE_FAILED: string;
38
+ PUBLISHING: string;
39
+ PUBLISH_FAILED: string;
40
+ DELETING: string;
41
+ DELETE_FAILED: string;
37
42
  };
38
43
  export declare const USE_INTERNAL_ENDPOINT: boolean;
39
44
  export declare const enum COS_ENDPOINT {
@@ -117,6 +117,10 @@ export interface IFunctionInfo {
117
117
  };
118
118
  };
119
119
  Triggers: ITrigger[];
120
+ StatusReasons: {
121
+ ErrorCode: string;
122
+ ErrorMessage: string;
123
+ }[];
120
124
  }
121
125
  export interface IFunctionCode {
122
126
  CosBucketName?: string;