mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2026-11-19 19:34:49 +08:00
feat: add MCP error metadata handling and improve source policy resolution (#14270)
* feat: add MCP error metadata handling and improve source policy resolution * fix: adjust height-diff for improved table layout
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/1Panel-dev/1Panel/agent/app/api/v2/helper"
|
||||
"github.com/1Panel-dev/1Panel/agent/utils/mcpapi"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func MCPErrorMetadata() gin.HandlerFunc {
|
||||
return helper.WithErrorMetadata(func(c *gin.Context, _ int, _ string, err error) {
|
||||
mcpapi.SetBusinessErrorHeader(c.Request, c.Writer.Header(), err)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user