MCPcopy Index your code
hub / github.com/yusing/godoxy / ErrorLoggingMiddleware

Function ErrorLoggingMiddleware

internal/api/handler.go:234–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232}
233
234func ErrorLoggingMiddleware() gin.HandlerFunc {
235 return gin.CustomRecoveryWithWriter(nil, func(c *gin.Context, err any) {
236 log.Error().Any("error", err).Str("uri", c.Request.RequestURI).Msg("Internal error")
237 if !c.IsWebsocket() {
238 c.JSON(http.StatusInternalServerError, apitypes.Error("Internal server error"))
239 }
240 })
241}

Callers 2

newAPIHandlerFunction · 0.92
NewHandlerFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected