Skip to content

Commit 6355e1b

Browse files
committed
🐛 Fix: sometime tencent-cloud error message is empty
1 parent 618cbc6 commit 6355e1b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/plugins/uploader/tcyun.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
112112
return {
113113
statusCode: 400,
114114
body: {
115-
msg: ctx.i18n.translate<ILocalesKey>('AUTH_FAILED')
115+
msg: ctx.i18n.translate<ILocalesKey>('AUTH_FAILED'),
116+
err
116117
}
117118
}
118119
})
@@ -123,7 +124,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
123124
body = res
124125
}
125126
if (body.statusCode === 400) {
126-
throw new Error(body.msg || body.message)
127+
throw new Error(body?.body?.err || body?.body?.msg || body?.body?.message)
127128
}
128129
const optionUrl = tcYunOptions.options || ''
129130
if (useV4 && body.message === 'SUCCESS') {

0 commit comments

Comments
 (0)