Parcourir la source

adding mcp error in toast (#22987)

tags/1.7.1
znn il y a 3 mois
Parent
révision
773932b1e7
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5
    1
      web/app/components/tools/mcp/modal.tsx

+ 5
- 1
web/app/components/tools/mcp/modal.tsx Voir le fichier

@@ -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)

Chargement…
Annuler
Enregistrer