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 76
76
"dependencies" : {
77
77
"@tencent-sdk/capi" : " ^1.1.5" ,
78
78
"@tencent-sdk/cls" : " ^0.1.7" ,
79
- "@ygkit/request" : " ^0.1.4 " ,
79
+ "@ygkit/request" : " ^0.1.8 " ,
80
80
"cos-nodejs-sdk-v5" : " ^2.6.2" ,
81
81
"moment" : " ^2.25.3" ,
82
82
"tencent-cloud-sdk" : " ^1.0.5"
Original file line number Diff line number Diff line change @@ -63,16 +63,23 @@ class Layer {
63
63
callback : async ( ) => this . getLayerDetail ( inputs . name , version ) ,
64
64
targetProp : 'Status' ,
65
65
targetResponse : 'Active' ,
66
+ failResponse : [ 'PublishFailed' ] ,
66
67
timeout : TIMEOUT ,
67
68
} ) ;
68
69
} catch ( e ) {
69
- const detail = await this . getLayerDetail ( inputs . name , version ) ;
70
+ const detail = e . response ;
70
71
if ( detail ) {
71
72
// if not active throw error
72
73
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
+ }
73
80
throw new ApiError ( {
74
81
type : 'API_LAYER_GetLayerVersion' ,
75
- message : `Cannot create layer success in 2 minutes, status: ${ detail . Status } (reqId: ${ detail . RequestId } )` ,
82
+ message : errMsg ,
76
83
} ) ;
77
84
}
78
85
} else {
You can’t perform that action at this time.
0 commit comments