Files
1Panel/agent/middleware/mcp_error_metadata.go
蘭 e29679768b 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
2026-11-02 22:17:12 +08:00

14 lines
366 B
Go

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