Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

adding mcp error in toast (#22987)

znn773932b1e737
diff --git a/web/app/components/tools/mcp/modal.tsx b/web/app/components/tools/mcp/modal.tsx
index 88e831bc3ab..b7202f52428 100644
--- a/web/app/components/tools/mcp/modal.tsx
+++ b/web/app/components/tools/mcp/modal.tsx
@@ -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)