adding mcp error in toast (#22987)

This commit is contained in:
znn 2025-07-26 08:07:52 +05:30 committed by GitHub
parent faaf828dff
commit 773932b1e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -95,8 +95,12 @@ const MCPModal = ({
setAppIcon({ type: 'image', url: res.url, fileId: extractFileId(res.url) || '' })
}
catch (e) {
let errorMessage = 'Failed to fetch remote icon'
const errorData = await (e as Response).json()
if (errorData?.code)
errorMessage = `Upload failed: ${errorData.code}`
console.error('Failed to fetch remote icon:', e)
Toast.notify({ type: 'warning', message: 'Failed to fetch remote icon' })
Toast.notify({ type: 'warning', message: errorMessage })
}
finally {
setIsFetchingIcon(false)