File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 7676 "dependencies" : {
7777 "@tencent-sdk/capi" : " ^1.1.5" ,
7878 "@tencent-sdk/cls" : " ^0.1.7" ,
79- "@ygkit/request" : " ^0.1.4 " ,
79+ "@ygkit/request" : " ^0.1.8 " ,
8080 "cos-nodejs-sdk-v5" : " ^2.6.2" ,
8181 "moment" : " ^2.25.3" ,
8282 "tencent-cloud-sdk" : " ^1.0.5"
Original file line number Diff line number Diff line change @@ -63,16 +63,23 @@ class Layer {
6363 callback : async ( ) => this . getLayerDetail ( inputs . name , version ) ,
6464 targetProp : 'Status' ,
6565 targetResponse : 'Active' ,
66+ failResponse : [ 'PublishFailed' ] ,
6667 timeout : TIMEOUT ,
6768 } ) ;
6869 } catch ( e ) {
69- const detail = await this . getLayerDetail ( inputs . name , version ) ;
70+ const detail = e . response ;
7071 if ( detail ) {
7172 // if not active throw error
7273 if ( detail . Status !== 'Active' ) {
74+ let errMsg = '' ;
75+ if ( e . message . indexOf ( 'TIMEOUT' ) !== - 1 ) {
76+ errMsg = `Cannot create layer success in 2 minutes, status: ${ detail . Status } (reqId: ${ detail . RequestId } )` ;
77+ } else {
78+ errMsg = `Publish layer fail, status: ${ detail . Status } (reqId: ${ detail . RequestId } )` ;
79+ }
7380 throw new ApiError ( {
7481 type : 'API_LAYER_GetLayerVersion' ,
75- message : `Cannot create layer success in 2 minutes, status: ${ detail . Status } (reqId: ${ detail . RequestId } )` ,
82+ message : errMsg ,
7683 } ) ;
7784 }
7885 } else {
You can’t perform that action at this time.
0 commit comments