Skip to content

Commit 29e77ae

Browse files
committed
fix: update error message
1 parent 5dff1b0 commit 29e77ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/serverless.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
const { Component } = require('@serverless/core')
22
const { Vpc } = require('tencent-component-toolkit')
3+
const { TypeError } = require('tencent-component-toolkit/src/utils/error')
34
const { prepareInputs } = require('./utils')
45

56
class ServerlessComponent extends Component {
67
getCredentials() {
78
const { tmpSecrets } = this.credentials.tencent
89

910
if (!tmpSecrets || !tmpSecrets.TmpSecretId) {
10-
throw new Error(
11-
'Cannot get secretId/Key, your account could be sub-account or does not have access, please check if SLS_QcsRole role exists in your account, and visit https://console.cloud.tencent.com/cam to bind this role to your account.'
11+
throw new TypeError(
12+
'CREDENTIAL',
13+
'Cannot get secretId/Key, your account could be sub-account and does not have the access to use SLS_QcsRole, please make sure the role exists first, then visit https://cloud.tencent.com/document/product/1154/43006, follow the instructions to bind the role to your account.'
1214
)
1315
}
1416

0 commit comments

Comments
 (0)