Skip to content

Commit e2e0acd

Browse files
committed
fix: update error message
1 parent 7221900 commit e2e0acd

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,5 +1,6 @@
11
const { Component } = require('@serverless/core')
22
const { Cos, Cdn } = require('tencent-component-toolkit')
3+
const { TypeError } = require('tencent-component-toolkit/src/utils/error')
34
const CONFIGS = require('./config')
45
const { prepareInputs } = require('./utils')
56

@@ -8,8 +9,9 @@ class ServerlessComponent extends Component {
89
const { tmpSecrets } = this.credentials.tencent
910

1011
if (!tmpSecrets || !tmpSecrets.TmpSecretId) {
11-
throw new Error(
12-
'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.'
12+
throw new TypeError(
13+
'CREDENTIAL',
14+
'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.'
1315
)
1416
}
1517

0 commit comments

Comments
 (0)