Skip to content

Commit

Permalink
fix: 反代错误时不输出反代地址
Browse files Browse the repository at this point in the history
  • Loading branch information
XasYer committed Dec 6, 2024
1 parent 4c35030 commit 7efd160
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@ export default class {
res = await fnc(e)
} catch (error) {
logger.error(error)
await e.reply(`出错辣! ${error.message}`)
let message = error.message
const keyMap = [
{ key: 'apiProxy', title: 'api反代' },
{ key: 'storeProxy', title: 'store反代' },
{ key: 'commonProxy', title: '通用反代' }
]
for (const i of keyMap) {
const url = Config.steam[i.key]
if (url && error.message) {
try {
const { host } = new URL(url)
message = message.replace(host, `${i.title}地址`)
} catch (error) { }
}
}
await e.reply(`出错辣! ${message}`)
}
clearTimeout(throttle[key])
delete throttle[key]
Expand Down

0 comments on commit 7efd160

Please sign in to comment.