Skip to content

Commit

Permalink
🐛 Fix: sometime tencent-cloud error message is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed Aug 23, 2022
1 parent 618cbc6 commit 6355e1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/uploader/tcyun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
return {
statusCode: 400,
body: {
msg: ctx.i18n.translate<ILocalesKey>('AUTH_FAILED')
msg: ctx.i18n.translate<ILocalesKey>('AUTH_FAILED'),
err
}
}
})
Expand All @@ -123,7 +124,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
body = res
}
if (body.statusCode === 400) {
throw new Error(body.msg || body.message)
throw new Error(body?.body?.err || body?.body?.msg || body?.body?.message)
}
const optionUrl = tcYunOptions.options || ''
if (useV4 && body.message === 'SUCCESS') {
Expand Down

0 comments on commit 6355e1b

Please sign in to comment.