mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-06 16:05:21 +00:00
* feat: add MCP error metadata handling and improve source policy resolution * fix: adjust height-diff for improved table layout
14 lines
366 B
Go
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)
|
|
})
|
|
}
|